@echo.
@echo. Installation of INVASION.WAD
@echo.
@echo. This will take some seconds, be patient.
@echo.
@rem Check main WAD
@if not exist doom.wad goto miss
@echo @echo. Restoration > restore.bat
@rem
@rem Check EXE Patch
@if not exist doom.exe goto miss
@if not exist invasion.deh goto miss
@rem
@rem Install EXE Patch
@copy doom.exe invasion.exe
@echo rm invasion.exe >> restore.bat
@rem
@dehacked -reload -load invasion.deh > hacked.log
@if not ERRORLEVEL 0 goto fail 
@rem Modify game command
@rem
@rem Install Sprites or Flats in WAD
@if not exist invasion.wad goto miss
@echo deusf -res invasion.wad >> restore.bat
@echo  Completing sprites and flats, please wait...
@deusf -main .\doom.wad -app invasion.wad> deusf.log
@if not ERRORLEVEL 0 goto fail 
@rem
@rem
@echo Installation succeeded.
@echo type INVALNCH to play the modified game.
@echo type RESTORE to uninstall.
@goto end
:fail
@echo. Installation failed: A tool didn't work.
@echo. See hack.log or deusf.log for details.
@goto end
:miss
@echo. Installation impossible: some files are missing.
@echo. Did you have deusf.exe and dehacked.exe ?
@echo. Please copy all your files in the main game directory.
@echo. And try install again.
@goto end
:end
