Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
v1.3 - Fixes and general improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
brysondev authored Jan 8, 2021
1 parent 47830a4 commit 9f5d187
Showing 1 changed file with 53 additions and 28 deletions.
81 changes: 53 additions & 28 deletions of_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,29 @@ echo.
echo Please make sure you have the required games installed before pressing continue!
echo Team Fortress 2 and Source SDK 2013 Multiplayer are REQUIRED for this game to run.
echo.
set /p gameInst="Do you want to install them now? (y/n): "

REG QUERY HKCU\SOFTWARE\Valve\Steam\Apps\440 > nul 2>&1
if %ERRORLEVEL% EQU 0 (
REG QUERY HKCU\SOFTWARE\Valve\Steam\Apps\243750 > nul 2>&1
if %ERRORLEVEL% EQU 0 (
goto cont
)
)

set /p gameInst="Games not detected. Do you want to install them now? (y/n): "
If /i "%gameInst%"=="y" goto instgm
If /i "%gameInst%"=="n" goto cont

:instgm
echo.
echo Installing TF2...
start iexplore.exe steam://install/440
start "" steam://install/440
echo.
echo Once the game has downloaded successfully, hit enter.
pause
echo.
echo Installing Source SDK 2013 Multiplayer...
start iexplore.exe steam://install/243750
start "" steam://install/243750
echo.
echo Once the game has downloaded successfully, hit enter.
pause
Expand Down Expand Up @@ -51,46 +60,62 @@ FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %PATH_STEAM% /v %VALUE_S
set STEAM_REG_PATH=%%C
)

if not exist %STEAM_REG_PATH%\NUL (
goto 32bitSteam
if not exist %STEAM_REG_PATH%\NUL > nul 2>&1(
if not exist "%STEAM_REG_PATH%\" > nul 2>&1(
echo Missing registry path for sourcemods. You know you need to download the required games right?
goto exitmain
)
)

:32bitSteam
:: :32bitSteam
:: 01/07/21 - If you don't have any source engine games installed or attempted to have installed, keys don't generate. The paths are still fucked tho...
::
:: Steam fucked up the registry keys for 32 bit systems https://i.imgur.com/w816RTW.png
:: Gotta use HKLM

set PATH_STEAM=HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam
set VALUE_STEAM=InstallPath

FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %PATH_STEAM% /reg:32 /v %VALUE_STEAM% 2^>nul`) DO (
set STEAM_REG_PATH=%%C
)

set "STEAM_REG_PATH=%STEAM_REG_PATH%\steamapps\sourcemods"

if not exist "%STEAM_REG_PATH%\" (
echo Steam not installed! ^(Or something broke...^)
goto exitmain
)
::
:: set PATH_STEAM=HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam
:: set VALUE_STEAM=InstallPath
::
:: FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %PATH_STEAM% /reg:32 /v %VALUE_STEAM% 2^>nul`) DO (
:: set STEAM_REG_PATH=%%C
:: )
::
:: set "STEAM_REG_PATH=%STEAM_REG_PATH%\steamapps\sourcemods"
::
:: if not exist "%STEAM_REG_PATH%\" (
:: echo Something broke...
:: goto exitmain
:: )

cd /D %STEAM_REG_PATH%
goto installOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:installOF
echo Installing Open Fortress...
echo.
echo Just press "OK" for anything that pops up. Everything is setup automatically!
echo.
:: This is such a pain since by default users won't install command line application...
if exist "open_fortress\.svn\wc.db" (
"%TORT_REG_PATH%" /command:update /path:".\open_fortress" /skipprechecks /closeonend:0
echo Cleaning up...
"%TORT_REG_PATH%" /command:cleanup /path:".\open_fortress" /cleanup /noui /noprogressui /breaklocks /refreshshell /externals /fixtimestamps /vacuum /closeonend:1
"%TORT_REG_PATH%" /command:update /path:".\open_fortress" /skipprechecks /closeonend:1
if not %ERRORLEVEL% == 0 (
echo Found an error. Attempting to relocate, update then cleanup...
echo.
"%TORT_REG_PATH%" /command:relocate /path:".\open_fortress" /closeonend:2
echo Please enter this url inside the box that just popped up: https://svn.openfortress.fun/svn/open_fortress
echo.
"%TORT_REG_PATH%" /command:update /path:".\open_fortress" /skipprechecks /closeonend:1
)
echo Cleaning up update...
echo.
"%TORT_REG_PATH%" /command:cleanup /path:".\open_fortress" /noui /noprogressui /breaklocks /refreshshell /externals /fixtimestamps /vacuum /closeonend:0
"%TORT_REG_PATH%" /command:cleanup /path:".\open_fortress" /cleanup /noui /noprogressui /breaklocks /refreshshell /externals /fixtimestamps /vacuum /closeonend:2
) ELSE (
"%TORT_REG_PATH%" /command:checkout /url:https://svn.openfortress.fun/svn/open_fortress /path:".\open_fortress" /closeonend:0
echo Cleaning up...
echo Make sure you click ok for the popup as I cannot through this script...
echo.
"%TORT_REG_PATH%" /command:checkout /url:https://svn.openfortress.fun/svn/open_fortress /path:".\open_fortress" /closeonend:2
echo Cleaning up install...
echo.
"%TORT_REG_PATH%" /command:cleanup /path:".\open_fortress" /noui /noprogressui /breaklocks /refreshshell /externals /fixtimestamps /vacuum /closeonend:0
"%TORT_REG_PATH%" /command:cleanup /path:".\open_fortress" /cleanup /noui /noprogressui /breaklocks /refreshshell /externals /fixtimestamps /vacuum /closeonend:2
)
goto finishMain
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -103,4 +128,4 @@ echo.
goto exitmain
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:exitmain
PAUSE
PAUSE

0 comments on commit 9f5d187

Please sign in to comment.