/// <summary> /// Parses data from update.xml located on the specified Uri /// </summary> private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { if (!Tools.CheckForInternetConnection()) { throw new WebException(lang.noInternetConnectionError, WebExceptionStatus.ConnectFailure); } IMUpdatable application = (IMUpdatable)e.Argument; if (!MUpdateXml.ExistsOnServer(application.UpdateXmlLocation)) { e.Cancel = true; } else { e.Result = MUpdateXml.Parse(application.UpdateXmlLocation, application.ApplicationID); } }
/// <summary> /// Initializes the update. /// </summary> /// <param name="applicationInfo">Specify the calling form (ex: this).</param> public MUpdater(IMUpdatable applicationInfo) { // 0. LOAD DLLS AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; this.applicationInfo = applicationInfo; if (applicationInfo.Language == "fr") { Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr"); } else { Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); } this.bgWorker = new BackgroundWorker(); this.bgWorker.DoWork += bgWorker_DoWork; this.bgWorker.RunWorkerCompleted += bgWorker_RunWorkerCompleted; }
public MUpdateAcceptForm(IMUpdatable applicationInfo, MUpdateXml updateInfo) { InitializeComponent(); this.applicationInfo = applicationInfo; this.updateInfo = updateInfo; this.Text = lang.updateAvailable; this.lblAppName.Text = this.applicationInfo.ApplicationName; if (this.applicationInfo.ApplicationIcon != null) { this.Icon = this.applicationInfo.ApplicationIcon; } this.lblUpdateAvailTitle.Text = lang.updateAvailable + ": " + this.updateInfo.Version.ToString(); //this.lblUpdaVers.Text = string.Format(lang.updateVersion + ": {0}", this.updateInfo.Version.ToString()); //this.lblCurrVers.Text = string.Format(lang.currentVersion + ": {0}", this.applicationInfo.ApplicationAssembly.GetName().Version.ToString()); this.txtDetails.Text = makeNewLines(this.updateInfo.Description); }