Exemplo n.º 1
0
        public void DownloadFileAndRun()
        {
            var updater = new ApplicationUpdater(typeof(Program));

            File.Delete(updater.DownloadStoragePath);

            Assert.IsTrue(updater.Download());
            Assert.IsTrue(File.Exists(updater.DownloadStoragePath));

            updater.ExecuteDownloadedFile();
        }
        public void DownloadFileAndRun()
        {
            var updater = new ApplicationUpdater(typeof(Program));

            File.Delete(updater.DownloadStoragePath);

            Assert.IsTrue(updater.Download());
            Assert.IsTrue(File.Exists(updater.DownloadStoragePath));

            updater.ExecuteDownloadedFile();
        }
Exemplo n.º 3
0
 public void CheckForNewVersion(bool force = false)
 {
     var updater = new ApplicationUpdater(typeof(Program));
     //updater.LastCheck = DateTime.UtcNow.AddDays(-50);
     if (updater.NewVersionAvailable(!force))
     {
         if (MessageBox.Show(updater.VersionInfo.Detail + "\r\n" +
             "Do you want to download and install this version?",
             updater.VersionInfo.Title,
             MessageBoxButtons.YesNo,
             MessageBoxIcon.Information) == DialogResult.Yes)
         {
             updater.DownloadProgressChanged += updater_DownloadProgressChanged;
             ShowStatus("Downloading Update - Version " + updater.VersionInfo.Version);
             updater.Download();
             updater.ExecuteDownloadedFile();
             ShowStatus("Download completed.");
             Application.Exit();
         }
     }
     App.Configuration.CheckForUpdates.LastUpdateCheck = DateTime.UtcNow.Date;
 }