public void DownloadFileWithEvents()
        {
            var updater = new ApplicationUpdater(typeof(Program));
            updater.DownloadProgressChanged += updater_DownloadProgressChanged;

            File.Delete(updater.DownloadStoragePath);

            Assert.IsTrue(updater.Download());
            Assert.IsTrue(File.Exists(updater.DownloadStoragePath));
        }
Ejemplo n.º 2
0
        public void DownloadFileWithEvents()
        {
            var updater = new ApplicationUpdater(typeof(Program));

            updater.DownloadProgressChanged += updater_DownloadProgressChanged;

            File.Delete(updater.DownloadStoragePath);

            Assert.IsTrue(updater.Download());
            Assert.IsTrue(File.Exists(updater.DownloadStoragePath));
        }
Ejemplo n.º 3
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();
        }
        public void DownloadInstallerTest()
        {
            var updater = new ApplicationUpdater("0.11");

            Console.WriteLine(updater.DownloadStoragePath);

            if (File.Exists(updater.DownloadStoragePath))
            {
                File.Delete(updater.DownloadStoragePath);
            }

            updater.Download();

            Assert.IsTrue(File.Exists(updater.DownloadStoragePath), "File should have been downloaded to download path");
        }
Ejemplo n.º 6
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;
 }