@echo off
REM ImagiNation Installation Executive
REM Shell file for installing INN 2.4 and additional content
REM User picks from a selection of installations. It installs, 
REM then returns to this menu program.
REM May want to modify this to exit after running the selected
REM installation.

REM Check to make sure I'm running from the drive and directory 
REM where this file is located.  Fails if there is a file of 
REM the same name in the current directory or path.
if exist INSTALL.BAT goto WALLPAPER
GOTO EXPLAIN

:WALLPAPER
CLS

REM If the CD-ROM drive letter is not the parameter, ask for it.
REM This should happen the first time it is run.
if "%1" == "" goto GETDRIVE

REM Put up wallpaper
ie wallpaper 9 1

REM Show Program Name
ie window 1 1 5 40 3 3 0 3
ie rowcol 2 9 "The ImagiNation Network" 0 3
ie rowcol 3 9 " Installation Executive" 0 3

REM Show Copyright
ie window 20 40 24 75 3 3 0 3
ie rowcol 21 52 "(C) 1995" 0 3
ie rowcol 22 46 "The ImagiNation Network" 0 3
REM ie rowcol 21 41 "(C) 1995 The Imagination Network" 0 3

GOTO START

:START
REM ie window 6 1 17 75 2 2  15 2 
REM ie rowcol 6 20 " ImagiNation Installation Executive " 15 2
REM ie rowcol 9 13 "This program will Install the various parts of the " 15 2
REM ie rowcol 10 13 "Imagination Network to your hard drive."  15 2
REM ie rowcol 12 13 "You will be prompted with a list of INN games that" 15 2
REM ie rowcol 13 13 "you can choose to Install to your system."  15 2  
REM 
REM rem Bottom border of window with pause message on it.
REM ie rowcol 16 22 " " 15 2
REM ie rowcol 16 54 " " 15 2
REM ie rowcol 16 23 
REM pause

:MAINMENU
REM Add program descriptions as help for each choice?
ie window 6 1 19 75 1 1 15 1 
ie rowcol 6 20 " ImagiNation Installation Executive " 15 1
ie rowcol 8 4 "   Choose the program you would like to install by typing the letter" 15 1
ie rowcol 9 4 "next to your selection."  15 1  
ie rowcol 11 4 "Press A - install it all!" 15 1
ie rowcol 12 4 "Press B - install The ImagiNation Network Basic Installation" 15 1
ie rowcol 13 4 "Press C - install Football Online (requires Basic Installation)" 15 1
ie rowcol 14 4 "Press D - install The Fates of Twinion (requires Basic Installation)"  15 1
ie rowcol 16 4 "Press X - exit to DOS" 15 1
ie rowcol 18 18 " Type the letter of your selection . . . " 15 1
ie inkey "abcdx"

IF ERRORLEVEL 6 GOTO END
IF ERRORLEVEL 5 GOTO END
IF ERRORLEVEL 4 GOTO TWINION
IF ERRORLEVEL 3 GOTO FOOTBALL
IF ERRORLEVEL 2 GOTO BASIC
IF ERRORLEVEL 1 GOTO ALL

REM In case it falls through for some reason
GOTO START

:ALL
REM Install INN Basic
cd inn
CLS
call inst24.bat
%1
cd ..

REM Install Football
cd football
CLS
call install -f
%1
cd ..

REM Install Twinion
cd twinion
CLS
call install -f
REM Make it end up where they can launch 2.4
REM %1
REM cd ..

GOTO END

:BASIC
REM Install INN Basic
cd inn
CLS
call inst24.bat
REM Make it end up where they can launch 2.4
REM %1
REM cd ..

GOTO END

:FOOTBALL
REM Install Football
cd football
CLS
call install -f
REM Make it end up where they can launch 2.4
REM %1
REM cd ..

GOTO END

:TWINION
REM Install Twinion
cd twinion
CLS
call install -f
REM Make it end up where they can launch 2.4
REM %1
REM cd ..

GOTO END


:EXPLAIN
REM Explain they're running from a different drive.
REM This is done using echo because they don't know where ie.exe is.
echo.
echo    Please run this program from the CD-ROM drive and directory
echo    that contains the ImagiNation installation program.  
echo    (Usually drive D: or E:.)
echo.
pause
GOTO END

:EXPLAIN2
REM Explain the CD-ROM they chose doesn't have the install file
ie window 7 10 16 70 4 4 14 4
ie rowcol 9 13  "   The CD-ROM drive you chose does not contain the"  15 4
ie rowcol 10 13 "ImagiNation installation program."  15 4
ie rowcol 12 13 "   Please press any key to continue, then reselect" 15 4
ie rowcol 13 13 "the drive letter of your CD-ROM drive."  15 4
rem Bottom border of window with pause message on it.
ie rowcol 15 22 " " 15 4
ie rowcol 15 54 " " 15 4
ie rowcol 15 23 
pause
GOTO GETDRIVE

:NONCDGETDRIVE
REM Use this when not running from a CD to fake it.
ie window 7 10 16 70 1 1 15 1
ie rowcol 9 13  "   Please press the letter that corresponds to the"  15 1
ie rowcol 10 13 "CD-ROM drive from which you are installing INN."  15 1
ie rowcol 12 13 "   For example, if your CD-ROM drive is drive D:," 15 1
ie rowcol 13 13 "press the letter D.  Valid drives are D through Z."  15 1
ie rowcol 15 19 " Type the letter of your CD-ROM drive . . . " 15 1
ie inkey "abcdefghijklmnopqrstuvwxyz"
GOTO PROCESSDRIVE

:GETDRIVE
ie getCurDrive

:PROCESSDRIVE
IF ERRORLEVEL	27	GOTO	END
IF ERRORLEVEL	26	GOTO	Z
IF ERRORLEVEL	25	GOTO	Y
IF ERRORLEVEL	24	GOTO	X
IF ERRORLEVEL	23	GOTO	W
IF ERRORLEVEL	22	GOTO	V
IF ERRORLEVEL	21	GOTO	U
IF ERRORLEVEL	20	GOTO	T
IF ERRORLEVEL	19	GOTO	S
IF ERRORLEVEL	18	GOTO	R
IF ERRORLEVEL	17	GOTO	Q
IF ERRORLEVEL	16	GOTO	P
IF ERRORLEVEL	15	GOTO	O
IF ERRORLEVEL	14	GOTO	N
IF ERRORLEVEL	13	GOTO	M
IF ERRORLEVEL	12	GOTO	L
IF ERRORLEVEL	11	GOTO	K
IF ERRORLEVEL	10	GOTO	J
IF ERRORLEVEL	 9	GOTO	I
IF ERRORLEVEL	 8	GOTO	H
IF ERRORLEVEL	 7	GOTO	G
IF ERRORLEVEL	 6	GOTO	F
IF ERRORLEVEL	 5	GOTO	E
IF ERRORLEVEL	 4	GOTO	D
IF ERRORLEVEL	 3	GOTO	C
IF ERRORLEVEL	 2	GOTO	B
IF ERRORLEVEL	 1	GOTO	A
IF ERRORLEVEL	 0 GOTO	NONCDGETDRIVE

:A
if not exist A:INSTALL.BAT goto EXPLAIN2
A:
install.bat A:
GOTO END

:B
if not exist B:INSTALL.BAT goto EXPLAIN2
B:
install.bat B:
GOTO END

:C
if not exist C:INSTALL.BAT goto EXPLAIN2
C:
install.bat C:
GOTO END

:D
if not exist D:INSTALL.BAT goto EXPLAIN2
D:
install.bat D:
GOTO END

:E
if not exist E:INSTALL.BAT goto EXPLAIN2
E:
install.bat E:
GOTO END

:F
if not exist F:INSTALL.BAT goto EXPLAIN2
F:
install.bat F:
GOTO END

:G
if not exist G:INSTALL.BAT goto EXPLAIN2
G:
install.bat G:
GOTO END

:H
if not exist H:INSTALL.BAT goto EXPLAIN2
H:
install.bat H:
GOTO END

:I
if not exist I:INSTALL.BAT goto EXPLAIN2
I:
install.bat I:
GOTO END

:J
if not exist J:INSTALL.BAT goto EXPLAIN2
J:
install.bat J:
GOTO END

:K
if not exist K:INSTALL.BAT goto EXPLAIN2
K:
install.bat K:
GOTO END

:L
if not exist L:INSTALL.BAT goto EXPLAIN2
L:
install.bat L:
GOTO END

:M
if not exist M:INSTALL.BAT goto EXPLAIN2
M:
install.bat M:
GOTO END

:N
if not exist N:INSTALL.BAT goto EXPLAIN2
N:
install.bat N:
GOTO END

:O
if not exist O:INSTALL.BAT goto EXPLAIN2
O:
install.bat O:
GOTO END

:P
if not exist P:INSTALL.BAT goto EXPLAIN2
P:
install.bat P:
GOTO END

:Q
if not exist Q:INSTALL.BAT goto EXPLAIN2
Q:
install.bat Q:
GOTO END

:R
if not exist R:INSTALL.BAT goto EXPLAIN2
R:
install.bat R:
GOTO END

:S
if not exist S:INSTALL.BAT goto EXPLAIN2
S:
install.bat S:
GOTO END

:T
if not exist T:INSTALL.BAT goto EXPLAIN2
T:
install.bat T:
GOTO END

:U
if not exist U:INSTALL.BAT goto EXPLAIN2
U:
install.bat U:
GOTO END

:V
if not exist V:INSTALL.BAT goto EXPLAIN2
V:
install.bat V:
GOTO END

:W
if not exist W:INSTALL.BAT goto EXPLAIN2
W:
install.bat W:
GOTO END

:X
if not exist X:INSTALL.BAT goto EXPLAIN2
X:
install.bat X:
GOTO END

:Y
if not exist Y:INSTALL.BAT goto EXPLAIN2
Y:
install.bat Y:
GOTO END

:Z
if not exist Z:INSTALL.BAT goto EXPLAIN2
Z:
install.bat Z:
GOTO END

:END
CLS
