Skip to content

Commit

Permalink
Correct launch-game.cmd join of quoted paths
Browse files Browse the repository at this point in the history
Unquote strings in launch-game.cmd and quote on use. Now correctly finds
directory when there are quotes in the mod.config files.
  • Loading branch information
Julia Filipchuk committed Sep 23, 2023
1 parent 2451b48 commit df14efa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions launch-game.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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%
Expand Down

0 comments on commit df14efa

Please sign in to comment.