Пример #1
0
 public static async void UpdatePrompt()
 {
     if (await MainWindow.ShowMessageDialogYesNo("Meldii update available", "Download Update?"))
     {
         SelfUpdater.RestartForUpdate();
     }
 }
Пример #2
0
 private static async Task FirefallUpdate()
 {
     // Check for a new Firefall patch.
     if (!Statics.FirefallPatchData.error)
     {
         var view = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
         using (var firefall = view.OpenSubKey(@"Software\Red 5 Studios\Firefall_Beta"))
         {
             // Check the installed version.
             var version = firefall.GetValue("InstalledVersion");
             if (version != null && (string)version != Statics.FirefallPatchData.build)
             {
                 // Our versions differ.
                 // C# await/async is going to kill me.
                 await App.Current.Dispatcher.Invoke(async() =>
                 {
                     if (await MainWindow.ShowMessageDialogYesNo("Firefall update available", "Start the Launcher to download the update?"))
                     {
                         // Remove all mods.
                         foreach (var addon in MainWindow.Self.ViewModel.LocalAddons)
                         {
                             if (!addon.IsAddon)
                             {
                                 MainWindow.Self.AddonManager.UninstallAddon(addon);
                             }
                         }
                         MainWindow.LaunchFirefallProcess("Launcher.exe");
                     }
                 });
             }
         }
     }
 }