@ECHO OFF
@COLOR 02
@TITLE Rayman: Raving Rabbids Run Fix (Buka)
@ECHO -----------------------
@ECHO Apply Patch? [ y / n ]
@ECHO -----------------------
@SET /P QUEST=
@IF NOT "%QUEST%"=="y" EXIT
@CLS
@CD /d "%~dp0"
@IF EXIST "Rayman4.tmp" DEL "Rayman4.tmp"
@IF EXIST "Rayman4.bf" REN "Rayman4.bf" "Rayman4.tmp"
@"_patcher.exe" -d -s "Rayman4.tmp" "_patcher.dat" "Rayman4.bf"
@IF "%ERRORLEVEL%" EQU "0" (SET PATCHEDOK=1) ELSE (SET PATCHEDOK=0)
@IF EXIST "%CD%\Rayman4.bf" (DEL "%CD%\Rayman4.tmp") ELSE (REN "%CD%\Rayman4.tmp" "Rayman4.bf")
@IF "%PATCHEDOK%" EQU "0" GOTO ERROR_PATCHING
@GOTO ALL_DONE
:ERROR_PATCHING
@PING -n 4 127.0.0.1 > nul
@EXIT
:ALL_DONE
@IF "%PATCHEDOK%" EQU "1" CLS & ECHO All done! & PING -n 3 127.0.0.1 > nul & DEL "_patcher.dat" & DEL "_patcher.exe" & DEL "%~f0" & EXIT