clear
space %1: 7390 NoSpace
godir %1:%4 CantCreate

rem  Copy over the necessary files.
rem  patches - if they exist - will be in the \both directory
echo Copying Startup Files ...
copy %2:\dosonly\*.*
copy %2:\both\*.*

rem  Create batch files on the fly and copy it to the root dir
if exist %2:\dosonly\sciv.exe echo sciv > sierra.bat
if exist %2:\dosonly\beta.exe echo beta > sierra.bat
if exist %2:\dosonly\sierra.exe echo sierra > sierra.bat
echo cd %4 > rain.bat
echo call sierra >> rain.bat
copy rain.bat %1:\

echo %3 > resource.cfg

echo Copying Game files...

exists %2:\disk2 Please insert the disk labeled "Disk 2" in drive %2:.
copy resource.000 + %2:\both\resource.000

exists %2:\disk3 Please insert the disk labeled "Disk 3" in drive %2:.
copy resource.000 + %2:\both\resource.000

exists %2:\disk4 Please insert the disk labeled "Disk 4" in drive %2:.
copy resource.000 + %2:\both\resource.000

rem echo Copying audio files
rem copy %2:\both\resource.aud
echo Please wait - decompressing audio.
echo This should take a few minutes.
%2:\auddcomp .\ %2:\both > nul

if ERRORLEVEL 1 goto AudError

rem  copy debug script if it's there
if exist %2:98.* copy %2:98.*

:exit
clear
echo
echo ˙To play NOW:
echo ˙   Type RAIN [ENTER].
echo
echo ˙To play LATER:
echo ˙   From the directory of %1:%4,
echo ˙   Type RAIN and press [ENTER].
echo
pause
goto Exit2


:NoSpace
clear
echo
echo There is not enough space on %1: to install 
echo Lost Secret of the Rainforest!
echo 7 megabytes of disk space are necessary.
echo
pause


:Exit2
end


:CantCreate
alert Unable to create directory %1:%4
end

:AudError
Alert AUDIO DECOMPERSSION FAILED!
end

