private void FinishVersionCheck(DefaultSettings settings) { if (settings.CheckForNewBuild) { if (webServiceError == false) { try { string newVersion = versionInfo.EndGetVersion(asyncResult); Assembly asmblyMyGen = System.Reflection.Assembly.GetAssembly(typeof(NewAbout)); string thisVersion = asmblyMyGen.GetName().Version.ToString(); System.Version newVersionObject = new System.Version(newVersion); if (newVersionObject > asmblyMyGen.GetName().Version) { this.Update(); UpdatesForm form = new UpdatesForm(); form.NewVersion = newVersion; form.ThisVersion = thisVersion; form.UpgradeText = versionInfo.GetUpdateText(); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { DownloadLatestVersion(); } } } catch { }; } } this.asyncResult = null; this.versionInfo = null; }
private void StartVersionCheck(DefaultSettings settings) { if (settings.CheckForNewBuild) { versionInfo = new VersionInfo(); try { asyncResult = versionInfo.BeginGetVersion(null, null); } catch { webServiceError = true; } } }