cd ..\..
godir %1:%4 CantCreate

if not exist vol\simsound.vol goto NoGame

if not exist vol\simvol0.vol goto minInst
if not exist vol\zones.vol goto medInst
goto maxInst

rem **********************************************************************
rem                        MINIMUM INSTALL
rem **********************************************************************

:minInst
space %1: 1000 NoMinSpace
clear

if not exist vol\simpatch.vol goto minUnpatched
rem *** Patch detected ***
godir %1:%4\vol CantCreate
del simpatch.vol
if exist pshell1.vol del pshell1.vol
godir %1:%4 CantCreate
if exist dbsim.exe del dbsim.exe
if exist escd.exe del escd.exe
if exist go.exe del go.exe

rem *** make executable batch file ***
echo @echo off>es.bat
echo mode co80>>es.bat
echo set ALT_DRIVE=%1:>>es.bat
echo set PREFER_ALT=1>>es.bat
echo %2:>>es.bat
echo escd>>es.bat
echo %1:>>es.bat

:minUnpatched

godir %1:%4\bar CantCreate
copy %2:bar\*.* .

godir %1:%4\data CantCreate
copy %2:data\*.* .

godir %1:%4\sos CantCreate
copy %2:sos\drum32.dig .

godir %1:%4\tapes CantCreate
copy %2:tapes\demo?.tap .

godir %1:%4\install CantCreate
copy %2:install\english\*.* .

godir %1:%4 CantCreate
copy %2:stuff\*.* .

clear
echo
echo  To play NOW:
echo    Type ES [ENTER].
echo
echo  To play LATER:
echo     From the directory of %1:%4,
echo     Type ES and press [ENTER].
echo     Make sure the CD is in the same
echo     drive that the game was installed from.
echo
pause

end

rem **********************************************************************
rem                        MEDIUM INSTALL
rem **********************************************************************

:medInst

space %1: 3000 NoMedSpace
clear

if not exist vol\simpatch.vol goto medUnpatched
rem *** Patch detected ***
godir %1:%4\vol CantCreate
del simpatch.vol
if exist pshell1.vol del pshell1.vol
godir %1:%4 CantCreate
if exist dbsim.exe del dbsim.exe
if exist escd.exe del escd.exe
if exist go.exe del go.exe

rem *** make executable batch file ***
echo @echo off>es.bat
echo mode co80>>es.bat
echo set ALT_DRIVE=%1:>>es.bat
echo set PREFER_ALT=1>>es.bat
echo %2:>>es.bat
echo escd>>es.bat
echo %1:>>es.bat

:medUnpatched

godir %1:%4\bar CantCreate
copy %2:bar\*.* .

godir %1:%4\data CantCreate
copy %2:data\*.* .

godir %1:%4\sos CantCreate
copy %2:sos\drum32.dig .

godir %1:%4\tapes CantCreate
copy %2:tapes\demo?.tap .

godir %1:%4\vol CantCreate
copy %2:vol\simlang.vol .
copy %2:vol\simpatch.vol .
if exist t.vol del t.vol

godir %1:%4\install CantCreate
copy %2:install\english\*.* .

godir %1:%4 CantCreate
copy %2:stuff\*.* .

clear
echo
echo  To play NOW:
echo    Type ES [ENTER].
echo
echo  To play LATER:
echo     From the directory of %1:%4,
echo     Type ES and press [ENTER].
echo     Make sure the CD is in the same
echo     drive that the game was installed from.
echo
pause

end

rem **********************************************************************
rem                        MAXIMUM INSTALL
rem **********************************************************************

:maxInst

space %1: 13500 NoMaxSpace
clear

if exist data\addr.bat goto maxunPatched1

rem *** Upgrading from floppy version ***
if not exist es.exe echo x >es.exe
copy %2:install\addres.exe .\install\addres.exe
if exist data\prefs.cfg copy %2:install\setpref.exe .\install\setpref.exe
echo @echo off >data\addr.bat
echo install\addres FlicPlayer pathFlic flic\ %2 resource.cfg >>data\addr.bat

:maxunPatched1
rem *** make executable batch file ***
echo @echo off>es.bat
echo mode co80>>es.bat
echo set ALT_DRIVE=%2:>>es.bat
echo set PREFER_ALT=>>es.bat
echo escd>>es.bat

godir %1:%4\bar CantCreate
copy %2:bar\*.* .

godir %1:%4\data CantCreate
copy %2:data\*.* .

godir %1:%4\sos CantCreate
copy %2:sos\drum32.dig .

godir %1:%4\tapes CantCreate
copy %2:tapes\demo?.tap .

godir %1:%4\vol CantCreate
copy %2:vol\simlang.vol .
copy %2:vol\simpatch.vol .
copy %2:vol\pshell0.vol .
copy %2:vol\pshell1.vol .
copy %2:vol\pshell2.vol .
copy %2:vol\pzones.vol .
copy %2:vol\pzones1.vol .
copy %2:vol\pspeech.vol .
if exist t.vol del t.vol
rem *** Speech volumes may not exist if upgrading floppy version.
if not exist simvoice.vol copy %2:vol\simvoice.vol .
if not exist speech.vol copy %2:vol\speech.vol .

godir %1:%4\install CantCreate
copy %2:install\english\*.* .

godir %1:%4 CantCreate
copy %2:stuff\*.* .

:maxUnpatched

copy %2:go.exe .
copy %2:dbsim.exe .
copy %2:detect.exe .
copy %2:escd.exe .

clear
echo
echo  To play NOW:
echo    Type ES [ENTER].
echo
echo  To play LATER:
echo     From the directory of %1:%4,
echo     Type ES and press [ENTER].
echo     Make sure the CD is in the same
echo     drive that the game was installed from.
echo
pause

end

:NoMinSpace
clear
echo
echo There is not enough space on %1: to install EarthSiege!
echo 1 megabyte of disk space is necessary.
echo
pause
goto fail

:NoMedSpace
clear
echo
echo There is not enough space on %1: to install EarthSiege!
echo 3 megabytes of disk space is necessary.
pause
goto fail

:NoMaxSpace
clear
echo
echo There is not enough space on %1: for the maximum sized
echo installation of Earthsiege. 13.5 Megabytes are necessary.
pause
goto fail


:CantCreate
alert Unable to create directory %1:%4
goto fail

:NoGame
alert Can't find EarthSiege installed in %1:%4
goto fail

:fail
cd install\english
end
