public void CheckForUpdateTest() { UpdateService update = new UpdateService(); var info = update.CheckForUpdate().Result; Assert.IsNotNull(info); }
private void Window_Loaded(object sender, RoutedEventArgs e) { UpdateService.CheckForUpdate(); if (File.Exists("updated.txt")) { File.Delete("updated.txt"); HelpButton_Click(null, null); } }
public void Run() { UpdateService.Cleanup(); if (Configuration.Updates.EnableAutomaticUpdates) { UpdateService.CheckForUpdate(); } StatisticsService.Run(); WebService.RunServer(); }
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; } }
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); } }
private void CurrentWindow_Loaded(object sender, RoutedEventArgs e) { UpdateService.CheckForUpdate(); }
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); }