/// <summary> /// Action performed when CheckUpdates is called /// </summary> private async void CheckUpdatesAction() { CanCheckUpdates = false; try { //if (AppUpdater.IsUpdatePackageAvailable()) // AppUpdater.InstallLatestVersion(); //else if (AppUpdater.IsUpdateAvailable) // await AppUpdater.DownloadLatestVersion(); //else await AppUpdater.CheckVersions(typeof(UpdateMenuViewModel)); OnUpdateView?.Invoke(this); Changelog = AppUpdater.ToString(); } catch (WebException) { System.Windows.Forms.MessageBox.Show("Could not reach server! Please try again later", "Could not reach server", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } CanCheckUpdates = true; }
private async void InitializeVersionService() { // Handle New version found AppUpdater.CheckVersionsCompleted += (sender, args) => { if (args.AskToDownloadHandled || args.TargetSubscriberType != null) { return; } if (args.HasNewVersionAvailable) { ViewManager.ShowWindow <UpdateMenuView>(); UpdateMenuString = "There's an update available!"; } args.AskToDownloadHandled = true; }; // Check for new versions try { await AppUpdater.CheckVersions(); } catch (WebException ex) { WindowLog.Error("SERVER_DOWN", "App"); } }