@

off
title Installing patch
@if not exist grasses.pck goto :notfoundreqfiles
@if not exist newgrasses.pck goto :notfoundpatchfiles
@if not exist oldgrasses.pck goto :notfoundpatchfiles
@if not exist sPCK.exe goto :notfoundpatchfiles
@if not exist UnInstall.bat goto :notfoundpatchfiles @

:install
:notfoundreqfiles
echo Grasses.pck not found!
echo.
echo All files from the archive to extract in
echo \Perfect World\element\
echo.
echo.
pause
exit
:notfoundpatchfiles
echo Not found the necessary files to install patch!
echo.
echo All files from the archive to extract in
echo \Perfect World\element\
echo.
echo.
pause
exit
:install
md workdir
copy newgrasses.pck workdir\newgrasses.pck
sPCK -pw -x workdir\newgrasses.pck
copy grasses.pck workdir\grasses.pck
sPCK -pw -x workdir\grasses.pck
xcopy "workdir\newgrasses.pck.files" workdir\grasses.pck.files\*.* /S /Y
sPCK -pw -c workdir\grasses.pck.files
copy workdir\grasses.pck grasses.pck
del newgrasses.pck /Q
rmdir workdir /S /Q
cls
echo Patch installation is complete
echo.
echo Restart the game if it is running
echo for the changes to come into force.
echo.
pause
del Install.bat /Q