Пример #1
0
        public void RunStartGame(StartGameData data, bool admin)
        {
            string           startGamePath = StartGameUtil.GetStartGamePath();
            ProcessStartInfo startInfo     = new ProcessStartInfo();

            startInfo.FileName  = startGamePath;
            startInfo.Arguments = data.GetAsArguments();

            if (admin)
            {
                startInfo.Verb = "runas";
            }
            else
            {
                //startInfo.RedirectStandardOutput = true;
                startInfo.UseShellExecute = false;
            }

            process = Process.Start(startInfo);

            //if (!admin) {
            //    process.OutputDataReceived += proc_OutputDataReceived;
            //    process.BeginOutputReadLine();
            //}
        }
Пример #2
0
        public static string[] ScanGames(SearchStorageInfo[] storage)
        {
            ClearStartData();

            StartGameApp app = new StartGameApp();

            app.BeginScanGames(storage);
            app.WaitForExit();

            string dataPath = StartGameUtil.GetStartDataPath();
            string data     = File.ReadAllText(dataPath);

            return(JsonConvert.DeserializeObject <string[]>(data));
        }
Пример #3
0
 public void BeginMultipleTasks(StartGameData[] tasks, bool admin)
 {
     data = StartGameUtil.BuildMultipleTaskData(tasks);
     RunStartGame(data, admin);
 }
Пример #4
0
 public void BeginScanGames(SearchStorageInfo[] storage)
 {
     data = StartGameUtil.BuildScanGamesData(storage);
     RunStartGame(data, true);
 }
Пример #5
0
 public void BeginSymlinkGames(SymlinkGameData[] games)
 {
     data = StartGameUtil.BuildSymlinkGameData(games);
     RunStartGame(data, true);
 }
Пример #6
0
 public void BeginScanKillMutex(string gameName, int instances, params string[] mutex)
 {
     data = StartGameUtil.BuildScanKillMutexData(gameName, instances, mutex);
     RunStartGame(data, true);
 }