Пример #1
0
        public void CheckForUpdateTest()
        {
            UpdateService update = new UpdateService();
            var           info   = update.CheckForUpdate().Result;

            Assert.IsNotNull(info);
        }
Пример #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     UpdateService.CheckForUpdate();
     if (File.Exists("updated.txt"))
     {
         File.Delete("updated.txt");
         HelpButton_Click(null, null);
     }
 }
Пример #3
0
 public void Run()
 {
     UpdateService.Cleanup();
     if (Configuration.Updates.EnableAutomaticUpdates)
     {
         UpdateService.CheckForUpdate();
     }
     StatisticsService.Run();
     WebService.RunServer();
 }
Пример #4
0
        public void CheckUpdates()
        {
            updateChecked = false;
            try {
                Version           currentVersion    = Assembly.GetExecutingAssembly().GetName().Version;
                UpdateService     updateService     = new UpdateService();
                UpdateInformation updateInformation = updateService.CheckForUpdate(currentVersion.ToString());
                updateVersion = new Version(updateInformation.Version);

                Settings.Default.lastUpdateCheck = DateTime.Now;
                if (updateVersion > currentVersion)
                {
                    updateUrl = updateInformation.InfoLink;
                }
                updateChecked = true;
            }
            catch (Exception) {
                updateUrl = string.Empty;
            }
        }
Пример #5
0
 protected override void Execute()
 {
     try
     {
         if (UpdateService.CheckForUpdate())
         {
             var result = MessageBox.Show("New version available. Download now?",
                 "Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.None);
             if (result == DialogResult.Yes)
             {
                 UpdateService.StartUpdater();
             }
         }
         else
         {
             MessageBox.Show("No new updates");
         }
     }
     catch (Exception ex)
     {
         DockingService.ShowError("Error updating", ex);
     }
 }
Пример #6
0
 private void CurrentWindow_Loaded(object sender, RoutedEventArgs e)
 {
     UpdateService.CheckForUpdate();
 }
Пример #7
0
        private static void Main(string[] args)
        {
            try
            {
                if (Settings.Default.FirstRun)
                {
                    Settings.Default.Upgrade();
                    Settings.Default.FirstRun = false;
                    Settings.Default.Save();
                }
            }
            catch (ConfigurationErrorsException ex)
            {
                DockingService.ShowError("Error upgrading settings", ex);
            }

            Application.EnableVisualStyles();

            DockPanel          panel              = new WabbitcodeDockPanel();
            StatusStrip        statusBar          = new WabbitcodeStatusBar();
            ToolStripContainer toolStripContainer = new WabbitcodeToolStripContainer(statusBar, panel);

            Task.Factory.StartNew(() => InitializeDependencies(panel, statusBar, toolStripContainer), TaskCreationOptions.PreferFairness);
            Task.Factory.StartNew(() =>
            {
                FileLocations.InitDirs();
                FileLocations.InitFiles();
                HighlightingUtils.MakeHighlightingFile();
            });

            Task.Factory.StartNew(() =>
            {
                if (!UpdateService.CheckForUpdate())
                {
                    return;
                }

                var result = MessageBox.Show("New version available. Download now?", "Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.None);
                if (result != DialogResult.Yes)
                {
                    return;
                }

                UpdateService.StartUpdater();
                Application.Exit();
            });

            int     numErrors = 0;
            AppBase appBase   = new AppBase(toolStripContainer);

#if !DEBUG
            try
            {
#endif
            appBase.Run(args);
#if !DEBUG
        }
        catch (Exception ex)
        {
            numErrors++;
            DockingService.ShowError("Unhandled exception occurred. Please report this to the developers", ex);
        }
#endif

            if (numErrors == 0)
            {
                return;
            }

            do
            {
                try
                {
                    appBase.DoEvents();
                }
                catch (Exception ex)
                {
                    numErrors++;
                    DockingService.ShowError("Unhandled exception occurred. Please report this to the developers", ex);
                }
            } while (numErrors < 5);
        }