Fix setup.bat if FF is installed to a non-standard library folder

This commit is contained in:
Ryan Liptak 2023-05-22 01:44:04 -07:00
parent d0fbf103f0
commit 0545286552

View file

@ -1,4 +1,5 @@
@echo off @echo off
setlocal enabledelayedexpansion
FOR /f "tokens=1,2*" %%E in ('reg query "HKEY_CURRENT_USER\Software\Valve\Steam"') DO ( FOR /f "tokens=1,2*" %%E in ('reg query "HKEY_CURRENT_USER\Software\Valve\Steam"') DO (
IF "%%E"=="SteamPath" ( IF "%%E"=="SteamPath" (
set SteamPath=%%G set SteamPath=%%G
@ -15,7 +16,27 @@ IF "%sourcesdk%"=="" (
exit /B exit /B
) )
set GameDir=%SteamPath%/steamapps/common/Fortress Forever for /F "usebackq tokens=*" %%L in ("%SteamPath%\steamapps\libraryfolders.vdf") do (
for /F "tokens=1*" %%A in ("%%L") do (
if "%%B" NEQ "" (
if "%%~A" EQU "path" (
set "CurPath=%%~B"
set "CurPath=!CurPath:\\=\!"
)
:: 253530 is the FF appid
if "%%~A" EQU "253530" (
set "GameDir=!CurPath!/steamapps/common/Fortress Forever"
)
)
)
)
IF "%GameDir%"=="" (
echo "%SteamPath%\steamapps\libraryfolders.vdf" does not contain FF's appid. Make sure Fortress Forever is installed
pause
exit /B
)
set ModDir=%GameDir%/FortressForever set ModDir=%GameDir%/FortressForever
IF NOT EXIST "%GameDir%" ( IF NOT EXIST "%GameDir%" (