예제 #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);
 }