From 07ec2d03fbfb93b37cead521db1d78880f501324 Mon Sep 17 00:00:00 2001 From: penev92 Date: Sun, 24 Apr 2022 19:18:05 +0300 Subject: [PATCH] Added an option to run utility.cmd programatically And still pass arguments to Utility.exe without having to manually input them. --- utility.cmd | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/utility.cmd b/utility.cmd index 09075cd9dd..33867a147c 100644 --- a/utility.cmd +++ b/utility.cmd @@ -1,6 +1,23 @@ @echo off title OpenRA.Utility.exe set ENGINE_DIR=.. + +set argC=0 +for %%x in (%*) do set /A argC+=1 + +if %argC% == 0 goto choosemod + +if %argC% == 1 ( + set mod=%1 + goto help +) + +if %argC% GEQ 2 ( + @REM This option is for use by other scripts so we don't want any extra output here - before or after. + call bin\OpenRA.Utility.exe %* + EXIT /B 0 +) + :choosemod echo ---------------------------------------- echo. @@ -20,7 +37,7 @@ goto choosemod echo. echo ---------------------------------------- echo. -echo OpenRA.Utility.exe %mod% +echo Starting OpenRA.Utility.exe %mod% call bin\OpenRA.Utility.exe %mod% :start echo. @@ -38,6 +55,6 @@ if /I "%command%" EQU "--mod" (goto choosemod) echo. echo ---------------------------------------- echo. -echo OpenRA.Utility.exe %mod% %command% +echo Starting OpenRA.Utility.exe %mod% %command% call bin\OpenRA.Utility.exe %mod% %command% goto start