#At file:///C:/Users/Reggie/work/wex/installer-updated/ based on revid:reggie.burnett@stripped
283 Reggie Burnett 2011-02-02
we now check for an update to ourselves when we do an upgrade check
modified:
WexInstaller/InstallWizard/DetailedUpdateCheck.cs
WexInstaller/MainForm.cs
WexInstaller/Program.cs
=== modified file 'WexInstaller/InstallWizard/DetailedUpdateCheck.cs'
=== modified file 'WexInstaller/InstallWizard/DetailedUpdateCheck.cs'
--- a/WexInstaller/InstallWizard/DetailedUpdateCheck.cs 2010-12-13 19:33:43 +0000
+++ b/WexInstaller/InstallWizard/DetailedUpdateCheck.cs 2011-02-02 15:20:17 +0000
@@ -8,6 +8,9 @@
using WexInstaller.Properties;
using WexInstaller.Core;
using System.Net;
+using System.Reflection;
+using System.IO;
+using System.Diagnostics;
namespace WexInstaller
{
@@ -198,6 +201,10 @@
UpdateProductList();
+ // this checks our new manifest to see if there is an update to ourselves
+ if (CheckForUpdate())
+ Application.OpenForms[0].Close();
+
nextOk = (productList.Items.Count > 0);
currentActionIcon.Visible = false;
skipUpdates.Enabled = false;
@@ -210,5 +217,37 @@
SignalChange();
}
+
+ private bool CheckForUpdate()
+ {
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ Version version = assembly.GetName().Version;
+ try
+ {
+ Version updateVersion = new Version(ProductManager.Manifest.UpdateVersion);
+ if (version >= updateVersion) return false;
+ DialogResult confirm = MessageBox.Show(Resources.UpdateAvailable, Resources.UpdateCaption,
+ MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ if (confirm == DialogResult.No) return false;
+ string path = Path.GetDirectoryName(assembly.Location);
+ string updateTool = String.Format("{0}{1}WexInstallerUpdater.exe",
+ path, Path.DirectorySeparatorChar);
+ if (!File.Exists(updateTool))
+ {
+ Logger.LogError("Unable to find update tool - " + updateTool);
+ return false;
+ }
+ ProcessStartInfo psi = new ProcessStartInfo();
+ psi.FileName = updateTool;
+ Process.Start(psi);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Logger.LogException(ex);
+ return false;
+ }
+ }
+
}
}
=== modified file 'WexInstaller/MainForm.cs'
--- a/WexInstaller/MainForm.cs 2011-02-02 15:07:37 +0000
+++ b/WexInstaller/MainForm.cs 2011-02-02 15:20:17 +0000
@@ -46,7 +46,7 @@
installWizardControl.ShowUpdateCheck(false);
installWizardControl.ShowFeatureSelection(true);
installWizardControl.ShowType(false);
- installWizardControl.ShowDetailedUpadte(false);
+ installWizardControl.ShowDetailedUpdate(false);
DoInstall();
}
=== modified file 'WexInstaller/Program.cs'
--- a/WexInstaller/Program.cs 2011-01-24 20:58:09 +0000
+++ b/WexInstaller/Program.cs 2011-02-02 15:20:17 +0000
@@ -28,45 +28,12 @@
Logger.LogInformation("Loading product manifest");
ProductManager.Load();
- if (CheckForUpdate())
- return;
Application.Run(new MainForm());
InstallerConfiguration.Save();
Logger.LogInformation("Installer exit");
}
- private static bool CheckForUpdate()
- {
- Assembly assembly = Assembly.GetExecutingAssembly();
- Version version = assembly.GetName().Version;
- try
- {
- Version updateVersion = new Version(ProductManager.Manifest.UpdateVersion);
- if (version >= updateVersion) return false;
- DialogResult confirm = MessageBox.Show(Resources.UpdateAvailable, Resources.UpdateCaption,
- MessageBoxButtons.YesNo, MessageBoxIcon.Question);
- if (confirm == DialogResult.No) return false;
- string path = Path.GetDirectoryName(assembly.Location);
- string updateTool = String.Format("{0}{1}WexInstallerUpdater.exe",
- path, Path.DirectorySeparatorChar);
- if (!File.Exists(updateTool))
- {
- Logger.LogError("Unable to find update tool - " + updateTool);
- return false;
- }
- ProcessStartInfo psi = new ProcessStartInfo();
- psi.FileName = updateTool;
- Process.Start(psi);
- return true;
- }
- catch (Exception ex)
- {
- Logger.LogException(ex);
- return false;
- }
- }
-
/* static bool ProcessCommandLineArguments()
{
bool checkForUpdates = false;
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110202152017-spoz7t0tl1eqi1jv.bundle
| Thread |
|---|
| • bzr commit into wex-installer-1.0 branch (reggie.burnett:283) | Reggie Burnett | 2 Feb |