public UpdateDownloadForm(Release release)
 {
     InitializeComponent();
     Icon = Icon.FromHandle(Resources.Update.GetHicon());
     Text = release.Name;
     changeLog.SetChangelog(release.Changelog);
     downloadProgress.DisplayStyle = TextProgressBar.ProgressBarDisplayText.Both;
     downloadProgress.CustomText = release.Asset.name;
     _releaseFile = new WebFile(new Uri(release.Asset.browser_download_url));
     _releaseFile.DownloadProgressChanged +=
         (sender, args) =>
         {
             downloadProgress.Invoke(new Action(() => { downloadProgress.Value = args.ProgressPercentage; }));
         };
     _releaseFile.DownloadFailed += (sender, @event) =>
     {
         AppLogger.Log.Error("Couldn't download the Release ", @event.Exception);
         MessageBox.Show(@event.Exception.Message, UpdateFormStrings.downloadFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
     };
     _releaseFile.Downloaded += (sender, args) =>
     {
         installButton.Invoke(new Action(() =>
         {
             installButton.Enabled = true;
             downloadProgress.Enabled = false;
         }));
     };
     _releaseFile.DownloadFile();
 }
Example #2
0
 public void Update(Release release, bool closeApp)
 {
     using (AppLogger.Log.InfoCall())
     {
         var file = new WebFile(new Uri(release.Asset.browser_download_url), InstallerFilePath);
         file.Downloaded += (sender, args) =>
         {
             AppLogger.Log.Info("Update downloaded: " + file);
             file.Start(InstallerParameters);
             if (closeApp)
             {
                 _context.Send(s => { Application.Exit(); }, null);
             }
         };
         file.DownloadFile();
     }
 }
Example #3
0
 public void Update(Release release, bool closeApp)
 {
     using (AppLogger.Log.InfoCall())
     {
         var file = new WebFile(new Uri(release.Asset.browser_download_url), InstallerFilePath);
         file.Downloaded += (sender, args) =>
         {
             AppLogger.Log.Info("Update downloaded: " + file);
             file.Start(InstallerParameters);
             if (closeApp)
             {
                 _context.Send(s => { Application.Exit(); }, null);
             }
         };
         file.DownloadFile();
     }
 }
Example #4
0
        public void Update(Release release, bool closeApp)
        {
            var file = new WebFile(new Uri(release.Asset.browser_download_url), InstallerFilePath);

            file.Downloaded += (sender, args) =>
            {
                Log.Information("Update downloaded: {@File}", file);
                if (!SignatureChecker.IsValid(file.FilePath))
                {
                    Log.Error("The file has the wrong signature. Update cancelled.");
                    return;
                }
                file.Start(InstallerParameters);
                if (closeApp)
                {
                    _context.Send(s => { Application.Exit(); }, null);
                }
            };
            file.DownloadFile();
        }