@ECHO OFF
@COLOR 02
@TITLE Revenant Patch 1.22 (US)
@ECHO ----------------------
@ECHO Apply Patch? [ y / n ]
@ECHO ----------------------
@SET /P QUEST=
@IF NOT "%QUEST%"=="y" EXIT
@CLS
@SET TDIR=Modules
@SET TFILEEXT1=rvi
@SET TFILEEXT2=rvr
@SET TFILEEXT3=rvm
@SET TFILE01=imagery
@SET TFILE02=resources
@SET TFILE03=AHKUILON
@SET TFILE04=Deathmatch6
@CD /d "%~dp0"
@IF NOT EXIST "%TFILE01%.%TFILEEXT1%" SET ERRFILE=%TFILE01%.%TFILEEXT1%& GOTO ERROR_NOT_FOUND
@"_packer.exe" -add -store -dir=relative -NoFix -NoZipExtension "%TFILE01%.%TFILEEXT1%" "%TFILE01%_%TFILEEXT1%/*.*"
@IF "%ERRORLEVEL%" EQU "0" (SET PATCHEDOK=1) ELSE (SET PATCHEDOK=0)
@IF "%PATCHEDOK%" EQU "0" GOTO ERROR_PATCHING
@IF NOT EXIST "%TFILE02%.%TFILEEXT2%" SET ERRFILE=%TFILE02%.%TFILEEXT2%& GOTO ERROR_NOT_FOUND
@"_packer.exe" -add -store -dir=relative -NoFix -NoZipExtension "%TFILE02%.%TFILEEXT2%" "%TFILE02%_%TFILEEXT2%/*.*"
@IF "%ERRORLEVEL%" EQU "0" (SET PATCHEDOK=1) ELSE (SET PATCHEDOK=0)
@IF "%PATCHEDOK%" EQU "0" GOTO ERROR_PATCHING
@IF NOT EXIST "%TDIR%\%TFILE03%.%TFILEEXT3%" SET ERRFILE=%TDIR%\%TFILE03%.%TFILEEXT3%& GOTO ERROR_NOT_FOUND
@"_packer.exe" -add -store -dir=relative -NoFix -NoZipExtension "%TDIR%\%TFILE03%.%TFILEEXT3%" "%TDIR%\%TFILE03%_%TFILEEXT3%/*.*"
@IF "%ERRORLEVEL%" EQU "0" (SET PATCHEDOK=1) ELSE (SET PATCHEDOK=0)
@IF "%PATCHEDOK%" EQU "0" GOTO ERROR_PATCHING
@IF NOT EXIST "%TDIR%\%TFILE04%.%TFILEEXT3%" SET ERRFILE=%TDIR%\%TFILE04%.%TFILEEXT3%& GOTO ERROR_NOT_FOUND
@"_packer.exe" -add -store -dir=relative -NoFix -NoZipExtension "%TDIR%\%TFILE04%.%TFILEEXT3%" "%TDIR%\%TFILE04%_%TFILEEXT3%/*.*"
@IF "%ERRORLEVEL%" EQU "0" (SET PATCHEDOK=1) ELSE (SET PATCHEDOK=0)
@IF "%PATCHEDOK%" EQU "0" (GOTO ERROR_PATCHING) ELSE (GOTO ALL_DONE)
:ERROR_PATCHING
@COLOR 04 & PAUSE & EXIT
:ERROR_NOT_FOUND
@COLOR 04 & ECHO File %ERRFILE% not found! & PAUSE & EXIT
:ALL_DONE
@IF "%PATCHEDOK%" EQU "1" (
CLS & ECHO All done! & PING -n 3 127.0.0.1 > nul
RMDIR "%TFILE01%_%TFILEEXT1%" /S /Q
RMDIR "%TFILE02%_%TFILEEXT2%" /S /Q
RMDIR "%TDIR%\%TFILE03%_%TFILEEXT3%" /S /Q
RMDIR "%TDIR%\%TFILE04%_%TFILEEXT3%" /S /Q
DEL "_packer.exe" & DEL "%~f0" & EXIT)