@echo off
cls
echo Install_GS5R3.bat
echo.
echo Updated: 10:30 PM 4/16/2010
echo.
echo Quickly deletes existing gs.mpq and renames 
echo GS5R3.mpq to gs.mpq automatically.  This file 
echo must be located in your SIERRA\LOMSE\ directory
echo (i.e. C:\SIERRA\LOMSE\) to function properly.
echo.
echo This DOES NOT automatically download the latest
echo GS5R2 update.
echo.
echo This batch can be used continually to (re)install
echo future GS5R3 updates (http://mantera.xorgate.com/).
echo.
echo -Mantera 
echo.
echo.
pause
echo.
echo File check:
if exist lomse.exe echo -File lomse.exe detected.
if exist gs5r3.mpq echo -File gs5r3.mpq detected.
if not exist lomse.exe echo -File lomse.exe NOT detected. 
if not exist gs5r3.mpq echo -File gs5r3.mpq NOT detected. 
echo.
echo.
if not exist lomse.exe goto nolomse 
if not exist gs5r3.mpq goto cancel 
pause

if exist gs.mpq goto undowriteprotection
if exist gs.mpq goto killgs
goto gs5r3-gs
echo.
echo Files renamed!
echo.
goto done

:undowriteprotection
attrib -R gs.mpq
echo Write protection of gs.mpq automatically 
echo removed to accomodate file deletion.
echo.

:killgs
del gs.mpq 
echo Deleting gs.mpq.
echo.

:gs5r3-gs
ren gs5r3.mpq gs.mpq
echo Renaming gs5r3.mpq to gs.mpq.
echo.

:done
echo Done!
echo.
echo.
pause
cls
exit

:cancel
echo Operation Cancelled!
echo. 
echo. 
pause
cls
exit

:nolomse
echo This batch file cannot detect lomse.exe. Please check your SIERRA\LOMSE\
echo directory (i.e. C:\sierra\lomse\) to verify that it is there.  This 
echo batch file works only if lomse.exe is in the directory.
echo.
echo.
goto cancel
