List:Commits« Previous MessageNext Message »
From:Mike Lischke Date:April 19 2011 11:59am
Subject:bzr commit into wex-installer-1.0 branch (mike.lischke:440)
View as plain text  
#At file:///D:/Work/MySQL/installer/ based on revid:mike.lischke@stripped

  440 Mike Lischke	2011-04-19
      ProductManager: new setup decision reworked. We also need a new-setup-run if the installer was started from the installer msi (which is indicated by specifying a catalog on the installer command line).

    modified:
      WexCmd/Program.cs
      WexInstaller.Core/InstallerConfiguration.cs
      WexInstaller.Core/ProductManager.cs
=== modified file 'WexCmd/Program.cs'
=== modified file 'WexCmd/Program.cs'
--- a/WexCmd/Program.cs	2011-03-31 21:10:25 +0000
+++ b/WexCmd/Program.cs	2011-04-19 11:59:32 +0000
@@ -443,10 +443,9 @@
           throw new OptionException("Error: No action specified.", "action");
 
         // Begin doing work here.
+        InstallerConfiguration.CatalogWasSpecified = catalog != null;
         if (catalog != null)
-        {
           InstallerConfiguration.ActiveCatalog = catalog;
-        }
         InstallerConfiguration.Load();
 
         ProductManager.Load();

=== modified file 'WexInstaller.Core/InstallerConfiguration.cs'
--- a/WexInstaller.Core/InstallerConfiguration.cs	2011-04-18 08:06:38 +0000
+++ b/WexInstaller.Core/InstallerConfiguration.cs	2011-04-19 11:59:32 +0000
@@ -19,7 +19,7 @@
 
     // Indicates if this configuration was loaded from file or is just a default config.
     private static bool isDefault = true;
-
+    
     #region Properties
 
     public static bool DisplayLicenseAgreement
@@ -119,6 +119,8 @@
       set { instance.ActiveCatalog = value; }
     }
 
+    public static bool CatalogWasSpecified { get; set; }
+    
     #endregion
 
     public static void Save()

=== modified file 'WexInstaller.Core/ProductManager.cs'
--- a/WexInstaller.Core/ProductManager.cs	2011-04-18 09:39:43 +0000
+++ b/WexInstaller.Core/ProductManager.cs	2011-04-19 11:59:32 +0000
@@ -220,9 +220,30 @@
       return true;
     }
 
+    /// <summary>
+    /// Returns true if this run is for a new setup. A new setup is defined either by not having
+    /// any MySQL products installed on the system or if a catalog was specified as parameter
+    /// which indicates we are running from an installer package rather than standalone.
+    /// </summary>
+    /// <returns></returns>
     public static bool IsNewSetup()
     {
-      return !(ProductsInstalled || ProductsUpgrade);
+      if (ActiveCatalog != null && InstallerConfiguration.CatalogWasSpecified)
+      {
+        if (CatalogProductsInstalled)
+          return false;
+        if (CatalogProductsUpgrade)
+          return false;
+        return true;
+      }
+      else
+      {
+        if (ProductsInstalled)
+          return false;
+        if (ProductsUpgrade)
+          return false;
+        return true;
+      }
     }
 
     private static void LoadManifestWithCheckForTemp()


Attachment: [text/bzr-bundle] bzr/mike.lischke@oracle.com-20110419115932-ik5b6yga9nfzx4sm.bundle
Thread
bzr commit into wex-installer-1.0 branch (mike.lischke:440) Mike Lischke19 Apr