コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 private void OpenWindowsFirewall(object sender, RoutedEventArgs e)
 {
     ProcesInvoker.StartNewProcessAsDialog("Celeste Windows Firewall Helper.exe");
 }
コード例 #4
0
 private void OpenWindowsFeatures(object sender, RoutedEventArgs e)
 {
     ProcesInvoker.StartNewProcessAsDialog("Celeste Windows Feature Selector.exe");
 }