From 2f7446e9fc153f9c4f1536499224f72f10fc1b77 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 23 Jan 2017 19:04:02 +0000 Subject: [PATCH] Pass Engine.LaunchPath from windows launcher. --- OpenRA.GameMonitor/GameMonitor.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenRA.GameMonitor/GameMonitor.cs b/OpenRA.GameMonitor/GameMonitor.cs index 3b185e9334..c730795408 100644 --- a/OpenRA.GameMonitor/GameMonitor.cs +++ b/OpenRA.GameMonitor/GameMonitor.cs @@ -27,12 +27,17 @@ namespace OpenRA [STAThread] static void Main(string[] args) { - var executableDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - var processName = Path.Combine(executableDirectory, "OpenRA.Game.exe"); + var launcherPath = Assembly.GetExecutingAssembly().Location; + var directory = Path.GetDirectoryName(launcherPath); + var enginePath = Path.Combine(directory, "OpenRA.Game.exe"); - Directory.SetCurrentDirectory(executableDirectory); + Directory.SetCurrentDirectory(directory); - var psi = new ProcessStartInfo(processName, string.Join(" ", args.Select(arg => "\"" + arg + "\""))); + var engineArgs = args + .Append("Engine.LaunchPath=" + launcherPath) + .Select(arg => "\"" + arg + "\""); + + var psi = new ProcessStartInfo(enginePath, string.Join(" ", engineArgs)); try {