Fix osx launcher. TODO: needs testing on 10.5

This commit is contained in:
Paul Chote
2011-05-04 20:21:09 +12:00
parent 221d6ebd4f
commit 22cd7ae1ad
8 changed files with 48 additions and 87 deletions

View File

@@ -30,18 +30,21 @@ namespace OpenRA
void ExecuteUtility(string args, Action<string> onComplete)
{
Process p = new Process();
p.StartInfo.FileName = Utility;
p.StartInfo.Arguments = "{0} --SupportDir \"{1}\"".F(args, Game.SupportDir);
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.EnableRaisingEvents = true;
p.Exited += (_,e) =>
try
{
onComplete(p.StandardOutput.ReadToEnd().Trim());
};
p.Start();
Process p = new Process();
p.StartInfo.FileName = Utility;
p.StartInfo.Arguments = "{0} --SupportDir \"{1}\"".F(args, Game.SupportDir);
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.EnableRaisingEvents = true;
p.Exited += (_,e) =>
{
onComplete(p.StandardOutput.ReadToEnd().Trim());
};
p.Start();
}
catch(System.ComponentModel.Win32Exception) {} // Don't crash if the process fails
}
}
}