public void CheckForNewVersion()
        {
            var updater = new ApplicationUpdater("0.01");           
            Assert.IsTrue(updater.NewVersionAvailable());

            updater = new ApplicationUpdater("1.0"); 
            updater.CurrentVersion = "9999.00";
            Assert.IsFalse(updater.NewVersionAvailable());


            updater = new ApplicationUpdater("0.78");
            Console.WriteLine(updater.NewVersionAvailable());

            updater = new ApplicationUpdater(typeof(Program));
            Console.WriteLine(updater.NewVersionAvailable());
        }
Example #2
0
        public void CheckForNewVersion()
        {
            var updater = new ApplicationUpdater("0.01");

            Assert.IsTrue(updater.NewVersionAvailable());

            updater = new ApplicationUpdater("1.0");
            updater.CurrentVersion = "9999.00";
            Assert.IsFalse(updater.NewVersionAvailable());


            updater = new ApplicationUpdater("0.78");
            Console.WriteLine(updater.NewVersionAvailable());

            updater = new ApplicationUpdater(typeof(Program));
            Console.WriteLine(updater.NewVersionAvailable());
        }
 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;
 }