@echo OFF
cls
echo.
echo.
echo                            /\
echo                          /ΔΔ  \               /\
echo                        /ΔΔΔ     \           /Δ   \
echo                      /ΔΔΔΔ        \       /ΔΔΔ     \
echo                 ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
echo.
echo                 See, he rides on a swift cloud of flame.
echo.
echo                 I will hand the Egyptians over to a cruel master
echo                 And a fierce lord will rule over them.
echo.
echo.                                           - Isaiah
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause > NUL

if not exist osiristc.gif goto ASCII
if not exist z.exe goto ASCII

z osiristc.gif /q
goto INTRO

:ASCII
echo.
echo.
echo         ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo           ___________________________________________________________
echo                 ______    ______    ___  _______   ___    ______
echo                ///  \\\  ///  \\\   ###  ###  \\\  ###   ///  \\\
echo                ³#     #  #      #   #+   #+     #  #+    #      #
echo                ³#     #  \\         #+   #+    /   #+    \\
echo                ³#     #    +__      #+   #++ \\    #+      +__
echo                ³#     #        \    #+   #+    \   #+          \
echo                ³#     #        ³³   #    #      #  #           ³³
echo                ³#     #        #    #    #      #  #            #
echo                ³+     #  _____/     #    #      #  #            #
echo                +      +  ++++       #    #     +   #            +
echo                +      +  ##         +    +         +            +
echo                +      +                                         +
echo                ³      ³                                        /
echo                   ++                                       +++
echo.
echo                       *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
echo                        A Total Conversion for Doom2 v1.9
echo                        by Glen Payne and Marshal Bostwick
echo                       *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
echo.
pause

:INTRO
cls
echo.
echo.
echo.
echo       This will install the OSIRIS Total Conversion for Doom2 v1.9.
echo.
echo       This installation will NOT modify your original Doom2 files.
echo       You'll still be able to play Doom2 normally.
echo.
echo       Be warned: OSIRIS requires approximately 8MB of disk space.  If
echo       you don't have the room, hit CTRL-C now to abort.
echo.
echo       Installing OSIRIS takes a few minutes.  Don't get nervous.
echo.
echo       To continue installing OSIRIS, press a key.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause > NUL

if exist OSIRIS.LOG del OSIRIS.LOG

echo.
echo Checking for DOOM2.EXE...
if exist DOOM2.EXE goto DOOM2_WAD
echo DOOM2.EXE >> OSIRIS.LOG

:DOOM2_WAD
echo Checking for DOOM2.WAD...
if exist DOOM2.WAD goto OSIRIS_WAD
echo DOOM2.WAD >> OSIRIS.LOG

:OSIRIS_WAD
echo Checking for OSIRIS.WAD...
if exist OSIRIS.WAD goto DEH_EXE
echo OSIRIS.WAD >> OSIRIS.LOG

:DEH_EXE
echo Checking for DEHACKED.EXE...
if exist DEHACKED.EXE goto OSIRIS_DEH
echo DEHACKED.EXE >> OSIRIS.LOG

:OSIRIS_DEH
echo Checking for OSIRIS.DEH...
if exist OSIRIS.DEH goto DEUS_EXE
echo OSIRIS.DEH >> OSIRIS.LOG

:DEUS_EXE
echo Checking for DEUSF.EXE...
if exist DEUSF.EXE goto OSIRIS_BAT
echo DEUSF.EXE >> OSIRIS.LOG

:OSIRIS_BAT
echo Checking for OSIRIS.BAT...
if exist OSIRIS.BAT goto REMOVE_BAT
echo OSIRIS.BAT >> OSIRIS.LOG

:REMOVE_BAT
echo Creating REMOVE.BAT...
echo @echo off > remove.bat
echo if exist o.exe del o.exe >> remove.bat
echo if exist osiris.wad del osiris.wad >> remove.bat
echo if exist osiris.bat del osiris.bat >> remove.bat
echo if exist install.bat del install.bat >> remove.bat
echo if exist dehacked.exe del dehacked.exe >> remove.bat
echo if exist deusf.exe del deusf.exe >> remove.bat
echo if exist osiris.txt del osiris.txt >> remove.bat
echo if exist osiristc.gif del osiristc.gif >> remove.bat
echo if exist z.exe del z.exe >> remove.bat
echo del remove.bat >> remove.bat

:CHK_LOG
if not exist OSIRIS.LOG goto CHECKOK

cls
echo.
echo ERROR. The following files were not found:
echo.
type OSIRIS.LOG
echo.
echo Make sure that your Doom2 directory is your current directory, and that
echo all files included in the OSIRIS package are in your Doom2 directory.
echo.
echo Press any key to exit...
pause > NUL
goto END

:CHECKOK
rem Check if dehacked.ini exists, and complain

if not exist DEHACKED.INI goto SAVEEXE
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo WARNING:
echo A dehacked.ini file exists here. That could compromise this
echo installation if you have a DOOM2 version previous to 1.9.
echo.
echo Please hit CTRL-C, delete or rename dehacked.ini if you're not
echo sure you really need it, and run this install again.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
goto saveexe

rem
rem Save executable only if DOOMHACK.EXE does not
rem already exist to prevent overwriting.
rem

:saveexe
cls
echo.
echo Creating the OSIRIS executable.

if not exist DOOMHACK.EXE goto NO_HACK
ren DOOMHACK.EXE DOOMHACK.ORG

:NO_HACK
copy DOOM2.EXE DOOMHACK.EXE > NUL

rem APPLY DEHACKED
dehacked -reload -load OSIRIS.DEH

if ERRORLEVEL 1 goto ERR_DEHACK
goto REN_EXE

:ERR_DEHACK
cls
echo.
echo *********
echo * ERROR *
echo *********
echo An error occured while applying Dehacked.
echo Do you have DOOM2 version 1.9?
echo. 
echo Installation was unsuccessful...Check your doom2 version.
pause
goto END


:REN_EXE
rem Renaming executable
if exist O.EXE del O.EXE
ren DOOMHACK.EXE O.EXE
del OSIRIS.DEH > NUL

rem APPLY DEUSF
rem deusf.exe defaults to doom.wad: avoid this

if exist doom.wad ren doom.wad doom1.wad >nul

DeuSF -sprites -app osiris.wad >> osiris.log
if ERRORLEVEL 1 goto ERR_DEUSF
goto DONE

:ERR_DEUSF
echo.
echo.
echo  *********
echo  * ERROR *
echo  *********
echo.
echo The installation was unsuccessful...
echo An error occured during sprite and flat generation.
echo Did you have enough disk space?
echo.
pause
goto END

:DONE
cls
echo.
echo   ΥΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΈ
echo   ³       ******** The OSIRIS Installation Was Successful ********       ³
echo   ³                                                                      ³
echo   ³   OSIRIS is meant to be played on ULTRAVIOLENT.  That's how we       ³
echo   ³   designed it; that's how it plays best.                             ³
echo   ³                                                                      ³
echo   ΓΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ΄
echo   ³                                                                      ³
echo   ³   Comments can be sent to:                                           ³
echo   ³                                                                      ³
echo   ³                       Glen Payne [rgp@apk.net]                       ³
echo   ³                    or Marshal Bostwick [mab@apk.net].                ³
echo   ³                                                                      ³
echo   ΤΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΎ
echo.
echo.
echo     Have fun.  Save a lot.
echo.
echo     To play a single-player game now, type OSIRIS.

:END
echo.
if exist DOOMHACK.ORG ren DOOMHACK.ORG DOOMHACK.EXE
if exist DOOM1.WAD ren DOOM1.WAD DOOM.WAD
