From df14efa7b80d3a76e23a224742b1ee175e985d02 Mon Sep 17 00:00:00 2001 From: Julia Filipchuk Date: Sat, 23 Sep 2023 16:42:39 -0700 Subject: [PATCH] Correct launch-game.cmd join of quoted paths Unquote strings in launch-game.cmd and quote on use. Now correctly finds directory when there are quotes in the mod.config files. --- launch-game.cmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/launch-game.cmd b/launch-game.cmd index b9479d610..3387de88b 100644 --- a/launch-game.cmd +++ b/launch-game.cmd @@ -2,8 +2,8 @@ setlocal EnableDelayedExpansion title OpenRA -FOR /F "tokens=1,2 delims==" %%A IN (mod.config) DO (set %%A=%%B) -if exist user.config (FOR /F "tokens=1,2 delims==" %%A IN (user.config) DO (set %%A=%%B)) +FOR /F "tokens=1,2 delims==" %%A IN (mod.config) DO (set %%A=%%~B) +if exist user.config (FOR /F "tokens=1,2 delims==" %%A IN (user.config) DO (set %%A=%%~B)) set TEMPLATE_LAUNCHER=%0 set MOD_SEARCH_PATHS=%~dp0mods,./mods @@ -12,9 +12,9 @@ if "!ENGINE_VERSION!" == "" goto badconfig if "!ENGINE_DIRECTORY!" == "" goto badconfig set TEMPLATE_DIR=%CD% -if not exist %ENGINE_DIRECTORY%\bin\OpenRA.exe goto noengine ->nul find %ENGINE_VERSION% %ENGINE_DIRECTORY%\VERSION || goto noengine -cd %ENGINE_DIRECTORY% +if not exist "%ENGINE_DIRECTORY%\bin\OpenRA.exe" goto noengine +>nul find %ENGINE_VERSION% "%ENGINE_DIRECTORY%\VERSION" || goto noengine +cd "%ENGINE_DIRECTORY%" bin\OpenRA.exe Game.Mod=%MOD_ID% Engine.EngineDir=".." Engine.LaunchPath="%TEMPLATE_LAUNCHER%" Engine.ModSearchPaths="%MOD_SEARCH_PATHS%" "%*" set ERROR=%errorlevel%