void CheckForUpdates() { Distro distro = CSScriptHelper.GetLatestAvailableVersion(); Invoke((Action) delegate { SetUpdateStatus(); Cursor = Cursors.Default; }); if (distro == null) { MessageBox.Show("Cannot check for updates. The latest release Web page will be opened instead.", "CS-Script"); try { Process.Start(Plugin.HomeUrl); } catch { } } else { var latestVersion = new Version(distro.Version); var nppVersion = Assembly.GetExecutingAssembly().GetName().Version; if (nppVersion == latestVersion) { MessageBox.Show("You are already running the latest version - v" + distro.Version, "CS-Script"); } else if (nppVersion > latestVersion) { MessageBox.Show("Wow... your version is even newer than the latest one - v" + distro.Version + ".", "CS-Script"); } else if (nppVersion < latestVersion) { PostCloseAction = //Task.Factory.StartNew( () => { using (var dialog = new UpdateOptionsPanel(distro)) dialog.ShowDialog(); };//); Invoke((Action) delegate { Close(); }); } } }
static void CheckForUpdates() { Thread.Sleep(2000); //let Notepad++ to complete all initialization Distro distro = CSScriptHelper.GetLatestAvailableVersion(); if (distro != null && distro.Version != Config.Instance.SkipUpdateVersion) { var latestVersion = new Version(distro.Version); var nppVersion = Assembly.GetExecutingAssembly().GetName().Version; if (nppVersion < latestVersion) { using (var dialog = new UpdateOptionsPanel(distro)) dialog.ShowDialog(); } } }