@echo off
if "%xxp%"=="" goto Demo
if "%getkey%"=="C" goto Config
if "%getkey%"=="D" goto Demo
Goto End

:Config
if exist c:\sierra\democd\gkmemok.dat del c:\sierra\democd\gkmemok.dat
install
if not exist c:\sierra\democd\gkdemo.cfg goto End

:Demo
if not exist c:\sierra\democd\Gkdemo.cfg goto Config

memsize 591
if errorlevel 1 goto LoMemOk
cls
echo.
echo Because this is an early pre-release demo of a game currently under 
echo development, the Gabriel Knight demo requires anywhere from 605,000 bytes
echo (591k) to 613,000 bytes (599k) of free memory to run, depending on your
echo sound card configuration.  We recognize that this is an unreasonably large
echo amount of free memory to require, but even though we have not completed
echo memory optimization for this product, we thought you would still like to 
echo have the opportunity to see this exciting demo.  The released version of 
echo the game will not echo require as much memory.
echo.
echo To run this demonstration, you must reconfigure your system to free up 
echo enough available memory.
echo.
if exist c:\sierra\democd\gkmemok.dat del c:\sierra\democd\gkmemok.dat 
if "%xxp%"=="" goto End
echo Press any key to continue.
getkey
goto BootDisk

:LoMemOK
if exist c:\sierra\democd\gkmemok.dat goto memok
memsize 599
if errorlevel 1 goto memok

cls
echo.
echo Because this is an early pre-release demo of a game currently under 
echo development, the Gabriel Knight demo requires anywhere from 605,000 bytes
echo (591k) to 613,000 bytes (599k) of free memory to run, depending on your
echo sound card configuration.  We recognize that this is an unreasonably large
echo amount of free memory to require, but even though we have not completed
echo memory optimization for this product, we thought you would still like to 
echo have the opportunity to see this exciting demo.  The released version of 
echo the game will not echo require as much memory.
echo.
echo You can attempt to run the demo at this time, and if you do not have enough
echo memory, the program will report the exact amount of additional memory 
echo required, based on your particular sound card configuration.
echo.
echo Do you want to attempt to run the demo now? (Y,N)
getkey YN
cls
if NOT "%getkey%"=="Y" goto BootDisk

sierra c:\sierra\democd\Gkdemo.cfg

if "%xxp%"=="" goto End
echo.
echo.
echo.
echo If the demo reported an error due to memory, press C to continue with 
echo options to reconfigure your system for proper operation.
echo.
echo If the demo ran properly, press X to return to the menu.
echo.
echo. Enter your choice. (C,X)
getkey CX
cls
if "%getkey%"=="ESC" goto End
if "%getkey%"=="C" goto BootDisk
echo.
echo Would you like to bypass the memory test 
echo when running this demo in the future? (Y,N)
getkey YN
cls
if not "%getkey%"=="Y" goto End
echo OK>c:\sierra\democd\gkmemok.dat
goto End

:BootDisk
if "%xxp%"=="" goto End
cls
echo.
echo A utility is provided on this CD-ROM to create a boot diskette that will 
echo configure your system to maximize free memory for running this demo.  
echo Depending on your particular machine configurations, this utility may 
echo be able to make enough memory available.  In most cases, it will require
echo DOS 6.0 or a third party memory manager such as QEMM or 386Max to make
echo enough memory available.
echo.
echo Do you want to run the Boot Disk Utility at this time? (Y,N)
getkey YN
if not "%getkey%"=="Y" goto End
cls
bootdisk\bootdisk -c
cls
echo.
echo.
echo.
echo If you have successfully created a boot disk, you must now restart your
echo computer with the boot disk inserted in the A: drive.  After rebooting
echo your computer, run DEMO from the Demo CD-ROM and retry this demonstration.
echo.
echo Reboot your system now, or press any key to return to the menu.
getkey
goto End

:MemOK
sierra c:\sierra\democd\Gkdemo.cfg

:End
