echo off
cls
echo Patching PBsys030.dll r30a03 > %1\patch.log
echo . >> %1\patch.log
echo If any of the following patches are successful >> %1\patch.log
echo PBSYS030.dll will be up to date >> %1\patch.log
echo .>> %1\patch.log
echo backing pbsys030.dll >> %1\patch.log

:remove previous failed attempt
erase %1\failed.pat


set path=%1

:perform patches
:PATCH

echo Performing patches >> %1\patch.log
echo . >> %1\patch.log

bpatch -p sysd30.r19 >> %1\patch.log
if not errorlevel 1 goto SUCCESS
bpatch -p sysd30a.r19 >> %1\patch.log
if not errorlevel 1 goto SUCCESS
bpatch -p sysi30.r19 >> %1\patch.log
if not errorlevel 1 goto SUCCESS
bpatch -p sysi30a.r19 >> %1\patch.log
if not errorlevel 1 goto SUCCESS

copy failed.pat %1\failed.pat
echo pbsys030.dll was not patched! >> %1\patch.log

:SUCCESS



:files on disk needed for syspat.bat to be successful
:bpatch.exe
:syspat.bat
:syspat.pif

:sysd30.r19
:sysd30a.r19
:sysi30.r19
:sysi30a.r19

