예제 #1
0
        private void StopRuntime()
        {
            var process = GetArcmageGameRuntimeProcess();

            if (process != null)
            {
                ImpersonateUserProcess.Impersonate(process, Settings.Current.GameRuntimeUser, Settings.Current.GameRuntimeUserPassword);
                process.Kill(true);
                process.WaitForExit();
            }
        }
예제 #2
0
        private void StartRuntime()
        {
            var process = GetArcmageGameRuntimeProcess();

            if (process == null)
            {
                var processStartInfo = new ProcessStartInfo("powershell.exe", "-File " + "startgameruntime.ps1");
                processStartInfo.RedirectStandardInput = false;
                processStartInfo.UseShellExecute       = false;
                processStartInfo.CreateNoWindow        = false;
                processStartInfo.WorkingDirectory      = Settings.Current.GameRuntimePath;

                process = new Process();
                ImpersonateUserProcess.Impersonate(process, Settings.Current.GameRuntimeUser, Settings.Current.GameRuntimeUserPassword);

                process.StartInfo = processStartInfo;
                process.Start();
            }
        }
예제 #3
0
        private void StartRuntime()
        {
            var process = GetArcmageGameRuntimeProcess();

            if (process == null)
            {
                // N.G. Somehow the msbuild publish doesn't copy the correct version of Microsoft.Data.SqlClient to the game runtime folder
                // Here's a hack that fixes this for windows-64 bit
                CopyGameRuntimeRequirements();

                var processStartInfo = new ProcessStartInfo(Path.Combine(Settings.Current.GameRuntimePath, GameRuntimeName));
                processStartInfo.RedirectStandardInput = false;
                processStartInfo.UseShellExecute       = true;
                processStartInfo.CreateNoWindow        = false;
                processStartInfo.WorkingDirectory      = Settings.Current.GameRuntimePath;

                process = new Process();
                ImpersonateUserProcess.Impersonate(process, Settings.Current.GameRuntimeUser, Settings.Current.GameRuntimeUserPassword);

                process.StartInfo = processStartInfo;
                process.Start();
            }
        }