@echo off
rem
rem Check if parameters were entered.
rem
if not $%1==$ goto next1
echo You will have to run this batch file from a DOS prompt.  Sorry.
echo Please enter the full pathname and directory name in which your Doom2 game is 
echo installed.
echo EG: install c:\Doom2
goto end

:next1
rem
rem Check that correct parameters were entered.
rem
if exist %1\Succubi.wad goto next2
echo The pathname or directory name was incorrect.  Please try again.
echo Enter the full pathname and directory name in which your Doom2 game is 
echo installed.
echo EG: install c:\Doom2
goto end

:next2
rem
rem Check that the parameters entered correspond to the Doom2 directory.
rem
if exist %1\Doom2.exe goto next3
echo The Doom2 program was not found in the directory you specified.  You must 
echo own Doom2, (the registered version) in order to play this game wad.  Sorry.
goto end

:next3
rem
rem If Dehacked was not previously installed, build it's INI file.
rem
if exist Dehacked.ini goto dehexist
copy doom2.exe doom2bk.exe
echo editname = %1\doom2.exe >> Dehacked.ini
echo normalname = %1\doom2bk.exe >> Dehacked.ini
echo wadname = %1\doom2.wad >> Dehacked.ini
echo patchdir = %1\Patches >> Dehacked.ini
md Patches
move Succubi.deh Patches
goto play

:dehexist
rem
rem If Dehacked was previously installed, verify the patches directory.
rem
if exist Patches goto next4
echo The batch file has encountered a problem.  You already have Dehacked installed 
echo in this directory but your Patches directory is not named "Patches" (the 
echo default).  You will have to manually continue the installation process from  
echo here. Hopefully the fact that you have dehacked already running indicates that 
echo you know enough to know how.  You will have to copy Succubi.deh to the directory 
echo in which your Dehacked is storing your patches.
echo The batch file will now continue building the Wad.  Good luck afterwards.  ;-)
pause
deusf -app Succubi.wad
goto end
:next4
move Succubi.deh Patches


:play
rem
rem Construct the play wad.
rem
deusf -app Succubi.wad
echo Would you like to play the game now?
choice
if errorlevel==2 goto end
Succubi

:end