clear

REM Sierra install script for Torin's Passage

REM %1 = dest drive
REM %2 = src  dir
REM %3 = Chosen drivers
REM %4 = dest dir

:Choose
godir %1:%4 cantcreate

cls

space %1: 3000 nospace

REM The install program is running from 
REM the install directory on the CD
copy %2:..\sierrah.exe	%1:
copy %2:..\sierra.err	%1:
copy %2:bootdisk.exe		%1:
copy %2:install.*			%1:
copy %2:*.drv				%1:
copy %2:checkcd.bat		%1:
copy %2:readme.*			%1:
copy %2:cpuid.exe			%1:
copy %2:dos4gw.exe		%1:
copy %2:hddtec.exe		%1:
copy %2:frog.bmp			%1:
copy %2:resource.cfg		%1:
copy %2:havevesa.exe		%1:
copy %2:uvconfig.exe		%1:
copy %2:what.exe			%1:


REM ====================================================
REM = Language files
REM ====================================================
REM Batch file to copy german messages to Patchdir
echo @echo off                               >german.bat
echo echo Converting to German subtitles	  >>german.bat
echo COPY %2:\german\msg\*.msg  %1:%4       >>german.bat

REM Batch file to copy french messages to Patchdir
echo @echo off                               >french.bat
echo echo Converting to French subtitles    >>french.bat
echo COPY %2:\french\msg\*.msg %1:%4        >>french.bat

REM Batch file to copy english messages to Patchdir
echo @echo off                               >english.bat
echo echo Converting to English subtitles   >>english.bat
echo if exist %1:%4\0.msg DEL %1:%4\*.msg   >>english.bat

REM ====================================================
REM = End of Language files
REM ====================================================



REM Batch file to run game from SIERRA directory
echo @echo off                               >..\torin.bat
echo %1:                                    >>..\torin.bat
echo cd %4                                  >>..\torin.bat
echo call CheckCD %2                        >>..\torin.bat
echo sierrah resource.cfg                   >>..\torin.bat

REM Batch file to run game from SIERRA\TORINDOS directory
copy ..\torin.bat torin.bat

REM add the chosen drivers and our paths to the resource file
echo %3                                 >resource.cfg
echo resSfx= %2:\                      >>resource.cfg
echo resAud= %2:\                      >>resource.cfg
echo resMap= %2:\                      >>resource.cfg
echo movieDir= %2:\movie               >>resource.cfg
REM echo animDir= %2:\anim                 >>resource.cfg
echo patchDir= %1:%4;%2:\patches       >>resource.cfg


REM Test for vesa support 
godir %1:%4
havevesa.exe
if ERRORLEVEL 1 goto novesa
goto done

REM Offer to create Universal Vesa Driver.
:novesa
echo
echo VESA support has not been detected. However you do 
echo have the option of constructing a universal VESA 
echo driver.
echo
echo Creating the universal VESA driver will not work 
echo on every computer system and/or video card.  If 
echo this function fails, you may have to contact your 
echo video card manufacturer for a VESA driver that will 
echo work for you.  Please consult the README file for 
echo more information.
echo  
echo Would you like to attempt this now? (Y/N) 
pick yn univesa done

:univesa
clear
alert Warning... Performing this function may cause your computer to lock. If this occurs, restart your computer, re-run the install program, and select NO for attempting to create the universal driver.
uvconfig.exe -gen
if exist univbe.drv goto success
clear
alert ERROR: Universal VESA driver not created.
goto done

:success
clear
echo
echo
echo
echo
echo    A Universal VESA driver was successfully created. 
echo 
echo
echo
echo
echo
echo
echo
echo
echo
echo
pause
goto done

:done
cls
echo
echo ˙To play Torin's Passage later:
echo ˙   From the directory of %1:%4,
echo ˙   Type TORIN and press [ENTER].
echo
pause
goto quit

:cantcreate
alert Unable to create directory %1:%4
pause
goto quit

:nospace
cls
echo
echo There is not enough space on %1: to install. 
echo 3 Megabytes of disk space is necessary for
echo the install.
echo
pause
goto quit

:quit
end

