internal EmpireUpdateInfoForm(IEmpireUpdate appInfo, EmpireUpdateXml updateInfo) { InitializeComponent(); if (appInfo.AppIcon != null) this.Icon = appInfo.AppIcon; this.Text = appInfo.AppName + " - Update Info"; this.lblVersions.Text = String.Format("Current Version: {0}\nUpdate Version: {1}", appInfo.AppAssembly.GetName().Version.ToString(), updateInfo.Version.ToString()); this.txtDescrition.Text = updateInfo.Description; }
private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { IEmpireUpdate app = (IEmpireUpdate)e.Argument; if (!EmpireUpdateXml.ExistsOnServer(app.UpdateXmlLoc)) { e.Cancel = true; } else { e.Result = EmpireUpdateXml.Parse(app.UpdateXmlLoc, app.AppID); } }
internal EmpireUpdateAcceptForm(IEmpireUpdate appInfo, EmpireUpdateXml updateInfo) { InitializeComponent(); this.appInfo = appInfo; this.updateInfo = updateInfo; this.Text = this.appInfo.AppName + " - Update Available"; if (this.appInfo.AppIcon != null) this.Icon = this.appInfo.AppIcon; this.lblNewVersion.Text = string.Format("New Version: {0}", this.updateInfo.Version.ToString()); }
internal EmpireUpdateInfoForm(IEmpireUpdate appInfo, EmpireUpdateXml updateInfo) { InitializeComponent(); if (appInfo.AppIcon != null) { this.Icon = appInfo.AppIcon; } this.Text = appInfo.AppName + " - Update Info"; this.lblVersions.Text = String.Format("Current Version: {0}\nUpdate Version: {1}", appInfo.AppAssembly.GetName().Version.ToString(), updateInfo.Version.ToString()); this.txtDescrition.Text = updateInfo.Description; }
private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (!e.Cancelled) { EmpireUpdateXml update = (EmpireUpdateXml)e.Result; if (update != null && update.isNewerThan(this.appInfo.AppAssembly.GetName().Version)) { if (new EmpireUpdateAcceptForm(this.appInfo, update).ShowDialog(this.appInfo.Context) == DialogResult.Yes) { this.DownloadUpdate(update); } } } }
internal EmpireUpdateAcceptForm(IEmpireUpdate appInfo, EmpireUpdateXml updateInfo) { InitializeComponent(); this.appInfo = appInfo; this.updateInfo = updateInfo; this.Text = this.appInfo.AppName + " - Update Available"; if (this.appInfo.AppIcon != null) { this.Icon = this.appInfo.AppIcon; } this.lblNewVersion.Text = string.Format("New Version: {0}", this.updateInfo.Version.ToString()); }
private void DownloadUpdate(EmpireUpdateXml update) { EmpireUpdateDownloadForm form = new EmpireUpdateDownloadForm(update.Uri, update.MD5, this.appInfo.AppIcon); DialogResult result = form.ShowDialog(this.appInfo.Context); if (result == DialogResult.OK) { string currentPath = this.appInfo.AppAssembly.Location; string newPath = Path.GetDirectoryName(currentPath) + "\\" + update.FileName; UpdateApplication(form.TempFilePath, currentPath, newPath, update.LaunchArgs); Application.Exit(); } else if (result == DialogResult.Abort) { MessageBox.Show("The update download was cancelled.\nTHisProgram has not been modified.", "Update Download Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("There was an error with the update, Please try again later.", "Update Download Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void DownloadUpdate(EmpireUpdateXml update) { EmpireUpdateDownloadForm form = new EmpireUpdateDownloadForm(update.Uri, update.MD5, this.appInfo.AppIcon); DialogResult result = form.ShowDialog(this.appInfo.Context); if (result == DialogResult.OK) { string currentPath = this.appInfo.AppAssembly.Location; string newPath = Path.GetDirectoryName(currentPath) + "\\" + update.FileName; UpdateApplication(form.TempFilePath, currentPath, newPath, update.LaunchArgs); Application.Exit(); } else if (result == DialogResult.Abort) { MessageBox.Show("The update download was cancelled.\nTHisProgram has not been modified.", "Update Download Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("There was an error with the update, Please try again later.", "Update Download Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } }