List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:September 17 2010 6:37pm
Subject:bzr commit into wex-installer-1.0 branch (reggie.burnett:199)
View as plain text  
#At file:///C:/work/wex/installer/ based on revid:iggy@stripped

  199 Reggie Burnett	2010-09-17
      simplifying how we are handling what products get installed for what setup type.  We will just use the includeByDefault property on a feature to determine if it is included in the default.  That way we can control that with the product manifest.  The others are easy as full is everything, server is all server, and custom is nothing.  So we can do away with the ProductFeature.SetInstallType and handle everything at the category level.

    modified:
      WexInstaller/Controls/FeatureBox.cs
      WexInstaller/Core/ProductCategory.cs
      WexInstaller/Core/ProductFeature.cs
      WexInstaller/InstallWizard/InstallType.cs
=== modified file 'WexInstaller/Controls/FeatureBox.cs'
=== modified file 'WexInstaller/Controls/FeatureBox.cs'
--- a/WexInstaller/Controls/FeatureBox.cs	2010-09-15 17:16:24 +0000
+++ b/WexInstaller/Controls/FeatureBox.cs	2010-09-17 18:37:46 +0000
@@ -57,7 +57,6 @@
             {
                 TreeNode node = featureList.Nodes.Add(feature.Title);
                 node.Tag = feature;
-                node.Checked = feature.ProposedInstalled;
             }
         }
 
@@ -70,7 +69,6 @@
                 {
                     TreeNode node = featureList.Nodes.Add(p.Title + " " + p.ThisVersion);
                     node.Tag = p;
-                    node.Checked = p.ProposedInstalled;
                 }
             }
         }
@@ -111,13 +109,14 @@
             if (p != null)
             {
                 if (p.Installed) return;
-                p.ProposedInstalled = e.Node.Checked;
+                p.ProposedInstalled = !p.ProposedInstalled;
             }
             else
             {
                 ProductFeature pf = e.Node.Tag as ProductFeature;
-                pf.ProposedInstalled = e.Node.Checked;
+                pf.ProposedInstalled = !pf.ProposedInstalled;
             }
+            featureList.Refresh();
             if (FeatureTree != null)
                 FeatureTree.Refresh();
         }
@@ -136,7 +135,7 @@
             else
             {
                 ProductFeature pf = (e.Node.Tag as ProductFeature);
-                if (pf.Installed || pf.ProposedInstalled) state = CheckBoxState.CheckedNormal;
+                if (pf.ProposedInstalled) state = CheckBoxState.CheckedNormal;
             }
 
             if (CBGlyphSize.IsEmpty)

=== modified file 'WexInstaller/Core/ProductCategory.cs'
--- a/WexInstaller/Core/ProductCategory.cs	2010-08-27 16:30:22 +0000
+++ b/WexInstaller/Core/ProductCategory.cs	2010-09-17 18:37:46 +0000
@@ -15,17 +15,17 @@
 
         public void SetInstallType(SetupType setupType)
         {
+            bool shouldInstall = setupType == SetupType.Full ||
+                (setupType == SetupType.ServerOnly && Type == ProductCategoryType.Server);
+
             foreach (Product p in Products)
             {
-                if (setupType == SetupType.ServerOnly)
-                {
-                    if (Type == ProductCategoryType.Server)
-                        p.SetInstallType(SetupType.DeveloperDefault);
-                    else
-                        p.SetInstallType(SetupType.Custom);
-                }
-                else
-                    p.SetInstallType(setupType);
+                p.ProposedInstalled = shouldInstall ||
+                    (setupType == SetupType.DeveloperDefault && p.IncludeInDefault);
+
+                foreach (ProductFeature pf in p.Features)
+                    pf.ProposedInstalled = shouldInstall ||
+                        (setupType == SetupType.DeveloperDefault && pf.IncludeInDefault);
             }
         }
 

=== modified file 'WexInstaller/Core/ProductFeature.cs'
--- a/WexInstaller/Core/ProductFeature.cs	2010-09-16 17:07:21 +0000
+++ b/WexInstaller/Core/ProductFeature.cs	2010-09-17 18:37:46 +0000
@@ -55,7 +55,6 @@
     public class ProductFeature : ProductElement
     {
         private bool proposedInstalled;
-        private bool includeSubfeatures;
 
         [XmlAttribute("id")]
         public string Id { get; set; }
@@ -110,12 +109,9 @@
         {
             if (shouldInstall == proposedInstalled) return;
             proposedInstalled = shouldInstall;
-            if (includeSubfeatures)
+            foreach (ProductFeature f in Features)
             {
-                foreach (ProductFeature f in Features)
-                {
-                    f.ProposedInstalled = shouldInstall;
-                }
+                f.ProposedInstalled = shouldInstall;
             }
         }
 
@@ -152,23 +148,6 @@
             }
         }
 
-        public void SetInstallType(SetupType setupType)
-        {
-            ProposedInstalled = (setupType == SetupType.Full) ||
-                (setupType == SetupType.DeveloperDefault && IncludeInDefault);
-            includeSubfeatures = (setupType != SetupType.Custom);
-            foreach (ProductFeature f in Features)
-                f.SetInstallType((ProposedInstalled) ? setupType : SetupType.Custom); // SetupType.Custom will prevent 'default' child Features from being installed.
-        }
-
-        public void DefaultFeature()
-        {
-            if (!IncludeInDefault) return;
-            ProposedInstalled = true;
-            foreach (ProductFeature f in Features)
-                f.DefaultFeature();
-        }
-
         public override void SetParent(ProductElement parent)
         {
             base.SetParent(parent);

=== modified file 'WexInstaller/InstallWizard/InstallType.cs'
--- a/WexInstaller/InstallWizard/InstallType.cs	2010-09-16 17:07:21 +0000
+++ b/WexInstaller/InstallWizard/InstallType.cs	2010-09-17 18:37:46 +0000
@@ -104,9 +104,6 @@
             foreach (ProductCategory cat in ProductManager.ProductCategories)
             {
                 cat.SetInstallType(type);
-                foreach (Product p in cat.Products)
-                    if (p.HasChanges) 
-                        p.ProposedInstalled = true;
             }
 
             ParentControl.ShowFeatureSelection(customType.Checked == true);


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20100917183746-h6b10pm0xnbwrr64.bundle
Thread
bzr commit into wex-installer-1.0 branch (reggie.burnett:199) Reggie Burnett17 Sep