Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct launch-game.cmd join of quoted paths #192

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

@abcdefg30 abcdefg30 Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>nul find %ENGINE_VERSION% "%ENGINE_DIRECTORY%\VERSION" || goto noengine
>nul find "%ENGINE_VERSION%" "%ENGINE_DIRECTORY%\VERSION" || goto noengine

Fixes the issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it will treat the version string as a file name without the quotations, which lead to the error I had yesterday.

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