ECHO OFF
SDL_ASK B
IF EXIST SDLSETUP.TXT ERASE SDLSETUP.TXT
ECHO SDLSETUP.BAT copyright (c) 1987-1989 Bob Stephan. All rights reserved.
ECHO * * *
ECHO This is a BATCH program so it may be a little slow, but
ECHO you don't have to run it very often so please be patient.
ECHO * * *
SDL_ASK E
IF NOT ERRORLEVEL 12 GOTO ENVIRON
IF NOT EXIST SDL.COM GOTO FILES
SDL @#$.$#@/!
IF ERRORLEVEL 143 GOTO VERSION
IF NOT ERRORLEVEL 142 GOTO VERSION
SDL_ASK F SDL.COM
IF NOT %WHAT% == 290E GOTO VERSION
ECHO This program will modify the file SDL.COM on this disk.
ECHO None of your original files will be modified in any way.  In
ECHO particular, your CONFIG.SYS and AUTOEXEC.BAT will not be touched.
ECHO * * *
ECHO Checking system resources. Please wait.
IF NOT EXIST ISLABEL.EXE GOTO CKDEBUG
ISLABEL MASDIR 4ù2E  >NUL
IF NOT ERRORLEVEL 1 GOTO CKDEBUG
ECHO If this is the original SDL disk you should establish a working
ECHO disk and/or directory to preserve the original (see SDLSETUP.DOC).
ECHO * * *
SDL_ASK C "Are you ready to continue (Y,n)? " YN}~
IF ERRORLEVEL 126 GOTO QUIT
IF NOT ERRORLEVEL 89 GOTO QUIT
:CKDEBUG Test for running DEBUG
IF EXIST DEBUG.COM GOTO CKFILES
IF EXIST DEBUG.TST ERASE DEBUG.TST
ECHO R >debug.txt
ECHO Q >>debug.txt
DEBUG <debug.txt >debug.tst
IF NOT EXIST DEBUG.TST GOTO NODEBUG
IF EXIST DEBUG.T?T ERASE DEBUG.T?T
:CKFILES
FOR %%F IN (SDLPARMS.BAT SDL_ASK.EXE) DO IF NOT EXIST %%F GOTO FILES
FOR %%F IN (SDLDEBUG.BAT SDLFINIS.BAT) DO IF NOT EXIST %%F GOTO FILES
SDL_ASK D
IF ERRORLEVEL 30 GOTO BEGIN
IF NOT ERRORLEVEL 20 GOTO NOT1
ECHO * * *
ECHO If you have any difficulty running SDLSETUP under DOS 2.x,
ECHO please see SDLSETUP.DOC.
ECHO * * *
:BEGIN
ECHO All checks completed, ready to proceed with SETUP.
ECHO * * *
ECHO If you do not want to continue with SDLSETUP press Esc to exit...
SDL_ASK C "Press C to continue, D to read the Documentation first(C,d,Esc): " CD}~
IF ERRORLEVEL 126 GOTO QUIT
IF ERRORLEVEL 125 GOTO CONTINUE
IF ERRORLEVEL 67 IF NOT ERRORLEVEL 68 GOTO CONTINUE
IF NOT EXIST SDLSETUP.DOC GOTO MENTION
SDL_SHOW SDLSETUP.DOC
ECHO Returning to SDLSETUP...
ECHO * * *
GOTO CONTINUE
:MENTION
echo SDLSETUP.DOC was not found and cannot be displayed now.
ECHO You may copy or print SDLSETUP.DOC from the original MASDIR disk.
Pause
:CONTINUE
REM Reset the size in WHAT
SDL_ASK F SDL.COM
SDLPARMS 142 143 %WHAT%
REM Normally the BATch file ends here, the rest are error messages.
GOTO QUIT
:NODEBUG
ECHO * * *
ECHO An error was encountered during the check of system resources.
ECHO If the error message was "File creation error" and/or "File not found"
ECHO it probably means the diskette is write protected.
ECHO * * *
ECHO If the message was "Bad command or file name" it means
ECHO that the system file DEBUG.COM is not available to SDLSETUP.
ECHO This program requires access to the DOS external command file
ECHO DEBUG.COM.  It must be in this directory on this disk or in
ECHO one of the directories on your path, which is
PATH
ECHO Please correct the problem and run SDLSETUP again.
goto quit
:FILES
ECHO * * *
ECHO The following files must be in this current directory on this disk:
FOR %%F IN (SDL.COM SDL_ASK.EXE SDLPARMS.BAT) DO ECHO %%F
FOR %%F IN (SDLSETUP.BAT SDLFINIS.BAT SDLDEBUG.BAT) DO ECHO %%F
GOTO QUIT
:NOT1
ECHO * * *
ECHO SDL and SDLSETUP require DOS 2.0 or higher.
GOTO QUIT
:VERSION
ECHO ÿ
ECHO * * *
ECHO The version of SDL.COM on this disk is incompatible with this
ECHO version of SDLSETUP.  Please copy compatible versions from
ECHO your original MASDIR disk and try again.
GOTO QUIT
:ENVIRON
ECHO * * *
ECHO There is insufficient DOS Environment space to run SDLSETUP.
ECHO You already have the following items set in the environment:
ECHO * * *
SET
ECHO * * *
ECHO SDLSETUP needs about 10 more bytes of space.  You can clear
ECHO one or more of the items out of the environment by entering
ECHO commands like
ECHO SET var=
ECHO Where var is the name of one of the objects shown between the
ECHO lines of asterisks above.  Each name is followed by the = sign.
ECHO When you enter the command do not put anything after the = sign,
ECHO not even a space.  Just press the Enter key (cr) immediately after
ECHO the = key.  Do not clear COMSPEC, PATH, or PROMPT.
ECHO After you have cleared one or more names from the environment,
ECHO run SDLSETUP again.
:QUIT
SET WHAT=
ECHO Exiting to DOS ...
