clear
godir %1:%4 cantcreate

echo Creating batch files...

echo @echo off >..\gabriel.bat
echo cd %4 >>..\gabriel.bat
echo sierra >>..\gabriel.bat
echo cd .. >>..\gabriel.bat

echo @echo off >gabriel.bat
echo sierra >>gabriel.bat

echo
echo Copying game files...
echo

copy %2:\dosonly\*.*
copy %2:\both\*.*

del resource.cfg
echo %3 >resource.cfg
echo patchDir=.\ >>resource.cfg
echo audiosize=6k >>resource.cfg



:exists %2:\disk2 Insert disk labelled "Disk 2" into drive %2:.
:copy %2:\both\*.*
:copy %2:\dosonly\sierra.exe

:exists %2:\disk3 Insert disk labelled "Disk 3" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.003

:exists %2:\disk4 Insert disk labelled "Disk 4" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.004

:exists %2:\disk5 Insert disk labelled "Disk 5" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.005

:exists %2:\disk6 Insert disk labelled "Disk 6" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.006

:exists %2:\disk7 Insert disk labelled "Disk 7" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.007

:exists %2:\disk8 Insert disk labelled "Disk 8" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.008

:exists %2:\disk9 Insert disk labelled "Disk 9" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.009

:exists %2:\disk10 Insert disk labelled "Disk 10" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.010

:exists %2:\disk11 Insert disk labelled "Disk 11" into drive %2:.
copy resource.000 + %2:\both\disk3-11\resource.011
:copy %2:\both\resource.sfx
copy %2:\auddcomp.exe

echo
echo Decompressing audio...Please wait
echo
auddcomp>nul
if errorlevel 1 goto auderr

del auddcomp.exe


:done
cd .. >nul
clear
echo
echo  To play Gabriel Knight now:
echo ˙   Type gabriel [ENTER].
echo
echo ˙To play Gabriel Knight later:
echo ˙   From the directory of %1:%4,
echo ˙   Type gabriel 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 16 Megabytes of disk space are necessary for
echo the install. 
pause
goto quit

:auderr
cls
echo
echo **Audio decompression failed**
echo Please reinstall game by placing disk 1
echo in drive and typing "Install."
echo
goto quit


:quit
end

