Preserve arguments passed into the windows launcher.
This commit is contained in:
@@ -32,10 +32,10 @@ namespace OpenRA
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
static int Main(string[] args)
|
static int Main(string[] args)
|
||||||
{
|
{
|
||||||
if (args.Any(x => x.Contains("Engine.LaunchPath")))
|
if (args.Any(x => x.StartsWith("Engine.LaunchPath=", StringComparison.Ordinal)))
|
||||||
return RunGame(args);
|
return RunGame(args);
|
||||||
|
|
||||||
return RunInnerLauncher();
|
return RunInnerLauncher(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int RunGame(string[] args)
|
static int RunGame(string[] args)
|
||||||
@@ -57,16 +57,18 @@ namespace OpenRA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int RunInnerLauncher()
|
static int RunInnerLauncher(string[] args)
|
||||||
{
|
{
|
||||||
var launcherPath = Assembly.GetExecutingAssembly().Location;
|
var launcherPath = Assembly.GetExecutingAssembly().Location;
|
||||||
var args = new[] { "Engine.LaunchPath=" + launcherPath };
|
var launcherArgs = args.ToList();
|
||||||
if (!string.IsNullOrEmpty(ModID))
|
|
||||||
args = args.Append("Game.Mod=" + ModID).ToArray();
|
|
||||||
|
|
||||||
args = args.Select(arg => "\"" + arg + "\"").ToArray();
|
if (!launcherArgs.Any(x => x.StartsWith("Engine.LaunchPath=", StringComparison.Ordinal)))
|
||||||
|
launcherArgs.Add("Engine.LaunchPath=\"" + launcherPath + "\"");
|
||||||
|
|
||||||
var psi = new ProcessStartInfo(launcherPath, string.Join(" ", args));
|
if (!launcherArgs.Any(x => x.StartsWith("Game.Mod=", StringComparison.Ordinal)))
|
||||||
|
launcherArgs.Add("Game.Mod=" + ModID);
|
||||||
|
|
||||||
|
var psi = new ProcessStartInfo(launcherPath, string.Join(" ", launcherArgs));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user