Example #1
0
 private async Task CheckForUpdatesComplete(Task <string> task)
 {
     try
     {
         string updateText = await task;
         if (updateText != null || !_applicationUpdateService.IsNewVersionAvailable())
         {
             return;
         }
         updateText = string.Format(CultureInfo.CurrentCulture, Resources.NewVersionAvailable, _applicationUpdateService.GetNewAvailableVersion());
         string           url = _applicationUpdateService.GetDownloadUri().AbsoluteUri;
         MessageBoxResult ret = MessageBoxResult.No;
         if (updateText != null && url != null)
         {
             ret = MessageBox.Show($"{updateText}\n{Resources.DownloadNewVersion}", Resources.DownloadNewVersionTitle, MessageBoxButton.YesNo);
         }
         if (ret == MessageBoxResult.Yes)
         {
             Process.Start(new ProcessStartInfo(url));
         }
     }
     catch (Exception e)
     {
         Logger.Error("ModuleController.CheckForUpdatesComplete: {0}", e.ToString());
     }
 }
 private void DownloadNewVersion()
 {
     try
     {
         Process.Start(new ProcessStartInfo(_applicationUpdateService.GetDownloadUri().AbsoluteUri));
     }
     catch (Exception exception)
     {
         ApplicationLogger.Error(exception);
     }
 }
Example #3
0
 private async Task <bool> CheckForUpdatesComplete(Task <string> task)
 {
     try
     {
         string updateText = await task;
         if (updateText != null || !_applicationUpdateService.IsNewVersionAvailable())
         {
             return(false);
         }
         updateText = string.Format(CultureInfo.CurrentCulture, Resources.NewVersionAvailable, _applicationUpdateService.GetNewAvailableVersion());
         string url = _applicationUpdateService.GetDownloadUri().AbsoluteUri;
         if (updateText != null && url != null &&
             MessageService.ShowYesNoQuestion($"{updateText}\n{Resources.DownloadAndInstallNewVersion}", Resources.DownloadNewVersionTitle))
         {
             return(DownloadAndUnzipUpdatePackage(url));
         }
     }
     catch (Exception e)
     {
         Logger.Error("ModuleController.CheckForUpdatesComplete: {0}", e);
     }
     return(false);
 }
Example #4
0
 private void DownloadNewVersion()
 {
     Process.Start(new ProcessStartInfo(applicationUpdateService.GetDownloadUri().AbsoluteUri));
 }