public static int StartGame(string pathToGame, string args, string workingDir = null) { StartGameApp app = new StartGameApp(); app.BeginStartGame(pathToGame, args, workingDir); app.WaitForExit(); return(app.GetOutputAsProcessId()); }
public static int StartGame(string pathToGame, string args, string workingDir = null) { string dataFile = GetStartDataGamePath(pathToGame); if (File.Exists(dataFile)) { File.Delete(dataFile); } StartGameApp app = new StartGameApp(); app.BeginStartGame(pathToGame, args, workingDir); app.WaitForExit(); string appId = File.ReadAllText(dataFile); return(int.Parse(appId)); }