public static void StartGameScanner(string gamePath, bool isSteamInstallation)
        {
            if (GameScanInProgress())
            {
                // TODO: Show message dialogue
                return;
            }

            var language = Thread.CurrentThread.CurrentCulture.Name;

            var adminRequired = !FileSystem.IsWritableDirectory(gamePath);

            ProcesInvoker.StartNewProcessAsDialog(GameScannerBinaryName, $"\"{gamePath}\" \"{language}\" {isSteamInstallation}", adminRequired);
        }
        private void ConfirmBtnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var currentApplicationFullPath = Assembly.GetEntryAssembly().Location;
                if (currentApplicationFullPath.EndsWith("AOEOnline.exe", StringComparison.OrdinalIgnoreCase))
                {
                    GenericMessageDialog.Show(Properties.Resources.SteamConverterAlreadySteamGame, DialogIcon.None, DialogOptions.Ok);
                    Close();
                    return;
                }

                var currentWorkingDirectory = Path.GetDirectoryName(currentApplicationFullPath);

                if (!File.Exists($"{currentWorkingDirectory}\\Spartan.exe"))
                {
                    GenericMessageDialog.Show(Properties.Resources.SteamConverterIncorrectInstallationDirectory, DialogIcon.None, DialogOptions.Ok);
                    Close();
                    return;
                }

                LegacyBootstrapper.UserConfig.GameFilesPath = currentWorkingDirectory;
                LegacyBootstrapper.UserConfig.Save(LegacyBootstrapper.UserConfigFilePath);

                var aoeoOnlineExePath   = Path.Combine(currentWorkingDirectory, "AOEOnline.exe");
                var converterNeedsAdmin = !IsWritableDirectory(aoeoOnlineExePath);

                ProcesInvoker.StartNewProcessAsDialog("SteamConverter.exe", runAsElevated: converterNeedsAdmin);
                ProcesInvoker.StartNewProcess(aoeoOnlineExePath);

                Environment.Exit(0);
            }
            catch (Exception ex)
            {
                Logger.Error(ex, ex.Message);
                GenericMessageDialog.Show(Properties.Resources.GenericUnexpectedErrorMessage, DialogIcon.Error, DialogOptions.Ok);
            }
        }
 private void OpenWindowsFirewall(object sender, RoutedEventArgs e)
 {
     ProcesInvoker.StartNewProcessAsDialog("Celeste Windows Firewall Helper.exe");
 }
 private void OpenWindowsFeatures(object sender, RoutedEventArgs e)
 {
     ProcesInvoker.StartNewProcessAsDialog("Celeste Windows Feature Selector.exe");
 }
Пример #5
0
 public static async Task WaitForGameToExit()
 {
     await ProcesInvoker.WaitForProcessToExit("Spartan");
 }