@CLS
@ECHO.  This is the installation batch file for WHEEL OF TIME DOOM3.
@ECHO.  This install will build up the elements of Wheel of Time Doom into
@ECHO.  playable wadfile, then run a 'cleaning' program on it to compress
@ECHO.  it somewhat.  
@ECHO.
@ECHO.  This install will also generate another batch file, WOTDOOM3.BAT,
@ECHO.  which you type in at the DOS prompt to play Wheel of Time Doom.  
@ECHO.  Do NOT add WoTDoom3.wad at the command line!  It won't work right!
@ECHO.  
@ECHO.  Then, this install file will remove the installation tools and this
@ECHO.  install.bat file itself, since you'll never need them again anyway.
@ECHO.  Your original DOOM2.EXE, DOOM2.WAD files will NOT be altered, but they
@ECHO.  are needed for the install to succeed.
@ECHO. 
@ECHO.  Press CTRL+C to abort this batch file at any moment.
@ECHO.
@ECHO.  A "batch file missing" message is normal, don't worry about it.
@ECHO.
@ECHO.  Understand?
@ECHO OFF
@PAUSE
@if not exist Doom2.exe goto faila
@if not exist Doom2.wad goto failb
@if not exist Wt_main.wad goto failc
@if not exist Wt_sp-ft.wad goto failc
@if not exist Dehacked.exe goto faild
@if not exist Wotdoom3.deh goto faile
@if not exist Deusf.exe goto failf
@if not exist cleanwad.exe goto failg
@if not exist Doomhack.exe goto continue
@ECHO ON
@ECHO. I have found an existing copy of DOOMHACK.EXE.  This likely means 
@ECHO. that you already use Dehacked.  In any event, I will need this 
@ECHO. filename briefly.  I will now temporarily rename your DOOMHACK.EXE
@ECHO. to HACKOLD.EXE, then after this install has successfully finished
@ECHO. I will rename HACKOLD.EXE back to DOOMHACK.EXE.  Ok?
@ECHO OFF
@echo A previously existing copy of Doomhack was found. >>>result.txt
@PAUSE
@if not exist HACKOLD.EXE goto beans
@ERASE HACKOLD.EXE
@goto beans
:beans
@RENAME DOOMHACK.EXE HACKOLD.EXE
@goto continue
:continue
@CLS
@ECHO ON
@ECHO.
@ECHO. Now I will expand WOTDOOM3.WAD into a playable wadfile.  Ignore the 
@ECHO. error messages that this program will generate.  (I didn't make the
@ECHO. silly thing.)
@ECHO OFF
@PAUSE
@DEUSF.EXE -APP Wt_sp-ft.WAD
@ECHO ON
@ECHO. Just to be sure, I'll do that again, please be patient.
@ECHO OFF
@DEUSF.EXE -APP Wt_sp-ft.WAD
@echo Deusf command carried through. >>>result.txt
@CLS
@ECHO ON
@ECHO. Next, I will use Dehacked.exe to create a new, separate EXE file for 
@ECHO. Wheel of Time Doom3.  To do so I will let Dehacked do it's thing and create
@ECHO. a new, pristine backup of your DOOM2.EXE file, which will then be modified,
@ECHO. and renamed WOTDOM3.EXE.  Your original copy of DOOM2.EXE will be left
@ECHO. untouched. 
@ECHO.
@ECHO. Answer "yes" to the next question, by the way. 
@ECHO OFF
@PAUSE
@DEHACKED.EXE -reload -load wotdoom3.deh
@RENAME DOOMHACK.EXE WOTDOM3.EXE
@echo Dehacked command completed. >>>result.txt
@echo wotdom3.exe -file wt_main.wad wt_sp-ft.wad >>WOTDOOM3.BAT
@If not exist HACKOLD.EXE goto moveon
@RENAME HACKOLD.EXE DOOMHACK.EXE
@goto moveon
:moveon
@CLS
@ECHO ON
@ECHO. Ok, now for some clean up! This final part of the install will now delete
@ECHO. the installation tools, and then this install.bat itself.  Also, I will
@ECHO. create an optional "cleanup" batchfile for you, named "CLEAN.BAT", which if
@ECHO. ran *should* compress WOTDOOM3.WAD a bit smaller.  Run it if you really want
@ECHO. to squeeze it tighter, but everytime I do it I get a "Memory leakage bug".
@ECHO. However the wad still seems to run fine.  (go figure.  that's why I left
@ECHO. it optional.)
@ECHO OFF
@PAUSE
@CLS
@ECHO Cleanwad.exe wt_sp-ft.wad wt_sp-f_.wad +is +pp >>>>CLEAN.BAT
@ECHO ERASE wt_sp-ft.wad  >>>>CLEAN.BAT
@ECHO RENAME wt_sp-f_.wad wt_sp-ft.wad >>>>CLEAN.BAT
@ECHO ERASE Cleanwad.exe >>>>CLEAN.BAT
@ECHO ERASE CLEAN.BAT >>>>CLEAN.BAT
@ECHO 
@ERASE DEUSF.EXE
@ERASE DEHACKED.EXE
@ERASE WOTDOOM3.DEH
@ECHO ON
@ECHO. Type "WOTDOOM3" at the DOS prompt every time you want to play it.  Don't
@ECHO. add in the wad at the command line!
@ECHO OFF
@PAUSE
@Echo the install has finished. >>>result.txt
@CLS
@ERASE INSTALL.BAT
:faila
@ECHO ON
@ECHO. I was unable to locate DOOM2.EXE.  Likely you have ran this install.bat
@ECHO. from a directory other than the one with DOOM2.EXE in it.  Move this file 
@ECHO. plus the others that came in the zipfile into the same directory that you
@ECHO. have DOOM2.EXE and DOOM2.WAD, and then rerun this install.bat.
@ECHO OFF
@echo couldn't find DOOM2.EXE. >>>result.txt
@goto end
:failb
@ECHO ON
@ECHO. I was unable to locate DOOM2.WAD.  Likely you have ran this install.bat
@ECHO. from a directory other than the one with DOOM2.WAD in it.  Move this file 
@ECHO. plus the others that came in the zipfile into the same directory that you
@ECHO. have DOOM2.EXE and DOOM2.WAD, and then rerun this install.bat.
@ECHO OFF
@echo couldn't find DOOM2.WAD >>>result.txt
@goto end
:failc
@ECHO ON
@ECHO. The critical elements of WoTDoom could not be found! Please unzip the ENTIRE 
@ECHO. contents of "WOTDOOM3.ZIP"
@ECHO. into the same directory as your DOOM2.EXE and DOOM2.WAD files.
@ECHO OFF
@echo WoTDoom3.wad was missing. >>>result.txt
@goto end
:faild
@ECHO ON
@ECHO. Dehacked.exe is missing!  Please unzip the ENTIRE contents of "WOTDOOM3.ZIP"
@ECHO. into the same directory as your DOOM2.EXE and DOOM2.WAD files.
@ECHO OFF
@echo Dehacked is missing. >>>result.txt
@Goto end
:faile
@ECHO ON
@ECHO. WoTDoom3.deh is missing! Please unzip the ENTIRE contents of "WOTDOOM3.ZIP"
@ECHO. into the same directory as your DOOM2.EXE and DOOM2.WAD files.
@ECHO OFF
@echo WoTDoom3.deh is missing. >>>result.txt
@goto end
:failf
@ECHO ON
@ECHO. Deusf.exe is missing! Please unzip the ENTIRE contents of "WOTDOOM3.ZIP"
@ECHO. into the same directory as your DOOM2.EXE and DOOM2.WAD files.
@ECHO OFF
@ECHO Deusf is gone, man. >>>result.txt
@goto end
:failg
@ECHO ON
@ECHO. Cleanwad.exe is missing! Please unzip the ENTIRE contents of "WOTDOOM3.ZIP"
@ECHO. into the same directory as your DOOM2.EXE and DOOM2.WAD files.
@ECHO OFF
@echo Cleanwad is missing. >>>result.txt
@goto end
:end
 
