List:Commits« Previous MessageNext Message »
From:Iggy Galarza Date:April 9 2011 5:45pm
Subject:bzr commit into wex-installer-1.0 branch (iggy:429)
View as plain text  
#At file:///C:/src/bzr.mysql/wex/installer/ based on revid:iggy@stripped

  429 Iggy Galarza	2011-04-09
      MSI - Setup now searches for registry DPI setting and passes it along to the Installer.
      Product - Make sure to not mark existing installs as upgrades for proudcts missing their UpgradeCode.
      ConfigPanel - Selectively filter "Try Again" action.

    modified:
      Setup/Product.wxs
      Setup/config.xml
      WexInstaller.Core/InstallerConfiguration.cs
      WexInstaller.Core/Product.cs
      WexInstaller.Core/Utilities.cs
      WexInstaller/InstallWizard/AllConfigOverview.cs
      WexInstaller/InstallWizard/InstallProgressPanel.cs
      WexInstaller/Program.cs
=== modified file 'Setup/Product.wxs'
--- a/Setup/Product.wxs	2011-04-08 13:22:47 +0000
+++ b/Setup/Product.wxs	2011-04-09 17:45:39 +0000
@@ -7,6 +7,14 @@
       <UpgradeVersion OnlyDetect="no" Maximum="$(var.ProductVersion)" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="yes" />
     </Upgrade>
 
+    <Property Id="CURRENTUSERDPI">
+      <RegistrySearch Id="CurrentUserDPI"
+                      Root="HKCU"
+                      Key="Control Panel\Desktop\WindowMetrics"
+                      Name="AppliedDPI"
+                      Type="raw" />
+    </Property>
+
     <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
     <Icon Id="InstallerIcon.exe" SourceFile="$(var.ProjectDir)..\WexInstaller\Resources\mysql-installer.ico"/>
     <Property Id="ARPPRODUCTICON" Value="InstallerIcon.exe"/>
@@ -48,6 +56,7 @@
               <util:XmlFile Id="SetProductCachePath" Action="setValue" ElementPath="//ProductCachePath" Value="[ProductCache]" File="[#config.xml]" SelectionLanguage="XPath" Sequence="1" />
               <util:XmlFile Id="SetInstallationRoot" Action="setValue" ElementPath="//InstallationRoot" Value="[INSTALLLOCATION]" File="[#config.xml]" SelectionLanguage="XPath" Sequence="2" />
               <util:XmlFile Id="SetProductCode" Action="setValue" ElementPath="//ProductCode" Value="[ProductCode]" File="[#config.xml]" SelectionLanguage="XPath" Sequence="3" />
+              <util:XmlFile Id="SetCurrentUserDPU" Action="setValue" ElementPath="//CurrentUserDPI" Value="[CURRENTUSERDPI]" File="[#config.xml]" SelectionLanguage="XPath" Sequence="4" />
 
               <File Id="products.xml" Name="products.xml.temp" Source="products.xml"/>
               <File Id="mytemplate.ini" Name="my-template.ini" Source="my-template.ini"/>

=== modified file 'Setup/config.xml'
--- a/Setup/config.xml	2011-03-30 15:08:55 +0000
+++ b/Setup/config.xml	2011-04-09 17:45:39 +0000
@@ -15,4 +15,5 @@
     <Y>84</Y>
   </Location>
   <ProductCode></ProductCode>
+  <CurrentUserDPI>0</CurrentUserDPI>
 </Configuration>
\ No newline at end of file

=== modified file 'WexInstaller.Core/InstallerConfiguration.cs'
--- a/WexInstaller.Core/InstallerConfiguration.cs	2011-04-07 14:19:22 +0000
+++ b/WexInstaller.Core/InstallerConfiguration.cs	2011-04-09 17:45:39 +0000
@@ -117,6 +117,32 @@ namespace WexInstaller.Core
       get { return instance.ActiveCatalog; }
       set { instance.ActiveCatalog = value; }
     }
+
+    public static int CurrentUserDPI
+    {
+      get 
+      {
+        int currentDPI;
+        // This value is initially read fromn the Registry so some cleanup may be required.
+        try
+        {
+          if (instance.CurrentUserDPI.StartsWith("#"))
+          {
+            instance.CurrentUserDPI = instance.CurrentUserDPI.Substring(1);
+          }
+
+          currentDPI = Convert.ToInt16(instance.CurrentUserDPI);
+        }
+        catch (Exception)
+        {
+          // Not to worry, we were only hoping for a hint is ok just to use OS reported values.
+          currentDPI = 0;
+        }
+
+        return currentDPI;
+      }
+      set { instance.CurrentUserDPI = value.ToString(); }
+    }
     #endregion
 
     public static void Save()
@@ -196,6 +222,7 @@ namespace WexInstaller.Core
     public Point Location { get; set; }
     public string ProductCode { get; set; }
     public string ActiveCatalog { get; set; }
+    public string CurrentUserDPI { get; set; }
 
     public InstallerConfigurationData()
     {

=== modified file 'WexInstaller.Core/Product.cs'
--- a/WexInstaller.Core/Product.cs	2011-04-09 02:14:47 +0000
+++ b/WexInstaller.Core/Product.cs	2011-04-09 17:45:39 +0000
@@ -1039,7 +1039,7 @@ namespace WexInstaller.Core
           Package thisPackage = GetPackage();
           Package possibleOlderPackage = new Package();
           possibleOlderPackage.Id = thisPackage.Id;
-          if (possibleOlderPackage.Installed)
+          if (possibleOlderPackage.Installed && possibleOlderPackage.ThisVersion != thisPackage.ThisVersion)
           {
             foundUpgradeableProducts = PopulateRelatePackageFeatures(possibleOlderPackage);
             if (foundUpgradeableProducts)

=== modified file 'WexInstaller.Core/Utilities.cs'
--- a/WexInstaller.Core/Utilities.cs	2011-04-08 17:42:06 +0000
+++ b/WexInstaller.Core/Utilities.cs	2011-04-09 17:45:39 +0000
@@ -33,6 +33,13 @@ namespace WexInstaller.Core
 
         return currentDPI;
       }
+      set
+      {
+        if (currentDPI == 0)
+        {
+          currentDPI = value;
+        }
+      }
     }
 
     /// <summary>

=== modified file 'WexInstaller/InstallWizard/AllConfigOverview.cs'
--- a/WexInstaller/InstallWizard/AllConfigOverview.cs	2011-04-07 14:04:55 +0000
+++ b/WexInstaller/InstallWizard/AllConfigOverview.cs	2011-04-09 17:45:39 +0000
@@ -178,20 +178,23 @@ namespace WexInstaller
     /// </summary>
     private void productList_LinkActivate(object sender, LinkActivationEventArgs e)
     {
-      if (configuringItem != null)
+      if (e.SubItem.Text.Contains(Resources.TryAgainLink))
       {
-        // Reset the current item.
-        configuringItem.StateImageIndex = -1;
-        SetLineColor(configuringItem, Color.LightGray);
-        (ParentControl as InstallWizardControl).RemoveConfigPages("Config");
-      }
+        if (configuringItem != null)
+        {
+          // Reset the current item.
+          configuringItem.StateImageIndex = -1;
+          SetLineColor(configuringItem, Color.LightGray);
+          (ParentControl as InstallWizardControl).RemoveConfigPages("Config");
+        }
 
-      configuringItem = e.Item;
-      configuringItem.StateImageIndex = 0;
-      SetLineColor(configuringItem, Color.Black);
-      (configuringItem.Tag as Product).Controller.PreAction();
-      (ParentControl as InstallWizardControl).AddConfigPages(configuringItem.Tag as Product);
-      NextButton.PerformClick();
+        configuringItem = e.Item;
+        configuringItem.StateImageIndex = 0;
+        SetLineColor(configuringItem, Color.Black);
+        (configuringItem.Tag as Product).Controller.PreAction();
+        (ParentControl as InstallWizardControl).AddConfigPages(configuringItem.Tag as Product);
+        NextButton.PerformClick();
+      }
     }
 
     #endregion

=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.cs	2011-04-07 14:04:55 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.cs	2011-04-09 17:45:39 +0000
@@ -74,7 +74,7 @@ namespace WexInstaller
       {
         foreach (Product p in pc.Products)
         {
-          if (p.IsUpgrade || p.HasChanges())
+          if ((p.ProposedInstalled == true) && (p.IsUpgrade || p.HasChanges()))
           {
             if (!p.FoundLocal)
               leftToDownload++;

=== modified file 'WexInstaller/Program.cs'
--- a/WexInstaller/Program.cs	2011-04-08 09:25:37 +0000
+++ b/WexInstaller/Program.cs	2011-04-09 17:45:39 +0000
@@ -17,6 +17,8 @@ namespace WexInstaller
       Logger.LogInformation("Installer starting up.");
 
       InstallerConfiguration.Load();
+      Utilities.CurrentDPI = InstallerConfiguration.CurrentUserDPI;  // This value is written by the installer.
+      InstallerConfiguration.CurrentUserDPI = 0;  // Once we've used it the first time, forget it.
 
       Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);


Attachment: [text/bzr-bundle] bzr/iggy@mysql.com-20110409174539-8f9igxmk15nae63h.bundle
Thread
bzr commit into wex-installer-1.0 branch (iggy:429) Iggy Galarza9 Apr