List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:February 14 2011 3:42pm
Subject:bzr commit into wex-installer-1.0 branch (reggie.burnett:335)
View as plain text  
#At file:///C:/Users/Reggie/work/wex/installer-updated/ based on revid:reggie.burnett@stripped

  335 Reggie Burnett	2011-02-14
      some work to get the installer working correctly

    modified:
      MySQLCA/CustomAction.cs
      Setup/Product.wxs
      Setup/config.xml
=== modified file 'MySQLCA/CustomAction.cs'
=== modified file 'MySQLCA/CustomAction.cs'
--- a/MySQLCA/CustomAction.cs	2011-02-10 19:36:56 +0000
+++ b/MySQLCA/CustomAction.cs	2011-02-14 15:42:24 +0000
@@ -43,10 +43,12 @@
         {
             session.Log("Begin DeleteFiles");
 
+            //StreamWriter writer = new StreamWriter(@"c:\\test.txt", false);
             try
             {
                 string[] arguments = GetCustomActionDataArguments(session);
 
+                //writer.WriteLine("Deleting data");
                 if (arguments == null || arguments.Length != 2)
                 {
                     session.Log("Error retrieving directories to delete");
@@ -54,16 +56,47 @@
                 }
                 Directory.Delete(arguments[0], true);
                 Directory.Delete(arguments[1], true);
+                //DeleteFolder(arguments[0]);
+                //DeleteFolder(arguments[1]);
+                //writer.WriteLine("success");
             }
             catch (Exception ex)
             {
+                //writer.WriteLine("ex type = " + ex.ToString());
+                //writer.WriteLine("ex type = " + ex.GetType());
+                //writer.WriteLine("error = " + ex.Message);
+                //writer.Flush();
+                //writer.Close();
                 session.Log(ex.Message);
                 return ActionResult.Failure;
             }
 
+            //writer.Flush();
+            //writer.Close();
             return ActionResult.Success;
         }
 
+        private static void DeleteFolder(string path)
+        {
+            Stopwatch sw = new Stopwatch();
+            sw.Start();
+            while (true)
+            {
+                try
+                {
+                    Directory.Delete(path, true);
+                    sw.Stop();
+                    return;
+                }
+                catch (IOException e)
+                {
+                    sw.Stop();
+                    if (sw.Elapsed.Seconds >= 20) throw;
+                    sw.Start();
+                }
+            }
+        }
+
         private static string[] GetCustomActionDataArguments(Session session)
         {
             string[] keys = new string[session.CustomActionData.Keys.Count];

=== modified file 'Setup/Product.wxs'
--- a/Setup/Product.wxs	2011-02-10 19:36:56 +0000
+++ b/Setup/Product.wxs	2011-02-14 15:42:24 +0000
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?define ProductName="MySQL Universal Installer"?>
-<?define ProductVersion="1.0.7.0"?>
+<?define ProductVersion="1.0.8.0"?>
 <?define CatalogName="mysql-5.5-gpl"?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
      xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
@@ -23,29 +23,34 @@
       <Directory Id="ProgramFilesFolder">
         <Directory Id="MySQL" Name="MySQL">
           <Directory Id="INSTALLLOCATION" Name="MySQL Universal Installer">
-            <Component Id="WexInstaller.exe" Guid="89A0E0A3-6E87-4C87-8F1D-6DC3D3D21CB4" Permanent="yes">
-              <File Id="WexInstaller.exe" Name="UniversalInstaller.exe" KeyPath="yes" Source="$(var.ProjectDir)..\WexInstaller\bin\$(var.Configuration)\WexInstaller.exe">
-                <Shortcut Id="mainShortcut" Directory="ShortCutDir" Advertise="yes" Icon="InstallerIcon.exe"
-                          Name="MySQL Universal Installer" WorkingDirectory="INSTALLLOCATION"/>
-              </File>
+            <Component Id="WexInstaller.exe" Guid="">
+              <File Id="WexInstaller.exe" Name="UniversalInstaller.exe" KeyPath="yes" Source="$(var.ProjectDir)..\WexInstaller\bin\$(var.Configuration)\WexInstaller.exe"/>
               <File Id="WexInstallerUpdater.exe" Name="WexInstallerUpdater.exe"
                     Source="$(var.ProjectDir)..\WexInstallerUpdater\bin\$(var.Configuration)\WexInstallerUpdater.exe"/>
               <File Id="MySql.Data.dll" Name="MySql.Data.dll" Source="$(var.ProjectDir)..\WexInstaller\bin\$(var.Configuration)\mysql.data.dll"/>
               <File Id="WexInstaller.Core.dll" Name="WexInstaller.Core.dll" Source="$(var.ProjectDir)..\WexInstaller\bin\$(var.Configuration)\wexinstaller.core.dll"/>
               <File Id="StandardPlugins.dll" Name="StandardPlugins.dll" Source="$(var.ProjectDir)..\StandardPlugins\bin\$(var.Configuration)\standardplugins.dll"/>
+            </Component>
+          </Directory>
+        </Directory>
+      </Directory>
+
+      <Directory Id="ProgramMenuFolder" Name="PMFolder">
+        <Directory Id='PMCompanyDir' Name='MySQL'>
+          <Directory Id="ShortCutDir" Name="$(var.ProductName)">
+            <Component Id="C_ShortCut" Guid="53607E47-D408-43A6-83B6-08D61AFED809">
+              <CreateFolder/>
+              <Shortcut Id="AppStartMenuShortCut" Name="MySQL Universal Installer"
+                        Target="[INSTALLLOCATION]\UniversalInstaller.exe" 
+                        WorkingDirectory="INSTALLLOCATION" Icon="InstallerIcon.exe"/>
               <RemoveFolder Id="DeleteShortcutFolder1" Directory="PMCompanyDir" On="uninstall" />
               <RemoveFolder Id="DeleteShortcutFolder2" Directory="ShortCutDir" On="uninstall" />
+              <RegistryValue Root="HKCU" Key="Software\MySQL\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
             </Component>
           </Directory>
         </Directory>
       </Directory>
 
-      <Directory Id="ProgramMenuFolder" Name="PMFolder">
-        <Directory Id='PMCompanyDir' Name='MySQL'>
-          <Directory Id="ShortCutDir" Name="$(var.ProductName)"/>
-        </Directory>
-      </Directory>
-
       <!-- 
       Install config.xml and products.xml under CommonAppDataFolder\MySQL\MySQL Universal Installer
       -->
@@ -64,14 +69,14 @@
                 <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" />
                 <!--<File Id="server" Name="mysql-5.1.54-win32.msi" Source="ProductCache\mysql-5.1.54-win32.msi"/>-->
-                <!--<File Id="server" Name="mysql-5.5.8-win32.msi" Source="ProductCache\mysql-5.5.8-win32.msi"/>
+                <File Id="server" Name="mysql-5.5.8-win32.msi" Source="ProductCache\mysql-5.5.8-win32.msi"/>
                 <File Id="workbench" Name="mysql-workbench-gpl-5.2.31a-win32.msi" Source="ProductCache\mysql-workbench-gpl-5.2.31a-win32.msi"/>
                 <File Id="connector_odbc" Name="mysql-connector-odbc-5.1.6-win32.msi" Source="ProductCache\mysql-connector-odbc-5.1.6-win32.msi"/>
-                <File Id="connector_cpp" Name="mysql-connector-c++-1.0.5-win32.msi" Source="ProductCache\mysql-connector-c++-1.0.5-win32.msi"/>-->
+                <File Id="connector_cpp" Name="mysql-connector-c++-1.0.5-win32.msi" Source="ProductCache\mysql-connector-c++-1.0.5-win32.msi"/>
                 <File Id="connector_c" Name="mysql-connector-c-6.0.2-win32.msi" Source="ProductCache\mysql-connector-c-6.0.2-win32.msi"/>
-                <!--<File Id="examples" Name="mysql-examples-5.1.0.msi" Source="ProductCache\mysql-examples-5.1.0.msi"/>
+                <File Id="examples" Name="mysql-examples-5.1.0.msi" Source="ProductCache\mysql-examples-5.1.0.msi"/>
                 <File Id="universion_docs" Name="mysql-universal-installer-document-bundle-1.0.0.0.msi" 
-                      Source="ProductCache\mysql-universal-installer-document-bundle-1.0.0.0.msi"/>-->
+                      Source="ProductCache\mysql-universal-installer-document-bundle-1.0.0.0.msi"/>
               </Component>
             </Directory>
           </Directory>
@@ -84,6 +89,7 @@
       <ComponentRef Id="WexInstaller.exe" />
       <ComponentRef Id="ConfigFiles" />
       <ComponentRef Id="Products" />
+      <ComponentRef Id="C_ShortCut"/>
     </Feature>
 
     <PropertyRef Id="NETFRAMEWORK35"/>
@@ -94,17 +100,17 @@
     <Binary Id="MySQLCA" SourceFile="MySQLCA.CA.dll"/>
 
     <CustomAction Id="DeleteFiles" BinaryKey="MySQLCA" DllEntry="DeleteFiles" Execute="deferred" Impersonate="no" Return="ignore"/>
-    <CustomAction Id="DeleteFiles.SetProperty" Return="check" Property="DeleteFiles" Value="[INSTALLLOCATION],[UniversalInstaller]"/>
+    <CustomAction Id="DeleteFiles.SetProperty" Return="check" Property="DeleteFiles" Value="[UniversalInstaller],[INSTALLLOCATION]"/>
 
     <CustomAction Id="SetLaunchApp" Property="LaunchAppPath" Value="[#WexInstaller.exe]"/>
-    <CustomAction Id="LaunchApp" Property="LaunchAppPath" ExeCommand="" Execute="deferred" Impersonate="no" Return="asyncNoWait"/>
+    <CustomAction Id="LaunchApp" Property="LaunchAppPath" ExeCommand="$(var.CatalogName)" Execute="deferred" Impersonate="no" Return="asyncNoWait"/>
 
     <InstallExecuteSequence>
       <RemoveExistingProducts After="InstallInitialize" />
       <Custom Action="SetLaunchApp" After="PublishProduct"/>
       <Custom Action="LaunchApp" After="SetLaunchApp">NOT(REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE)</Custom>
       
-      <Custom Action="DeleteFiles.SetProperty" Before="InstallFinalize">REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>
+      <Custom Action="DeleteFiles.SetProperty" After="RemoveFiles">REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>
       <Custom Action="DeleteFiles" After="DeleteFiles.SetProperty">REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>
     </InstallExecuteSequence>
 

=== modified file 'Setup/config.xml'
--- a/Setup/config.xml	2010-11-22 18:28:54 +0000
+++ b/Setup/config.xml	2011-02-14 15:42:24 +0000
@@ -2,9 +2,6 @@
 <Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <UpdateURLs>
     <UpdateURL>
-      <URL>http://downloads.mysql.com/reg/products.xml</URL>
-    </UpdateURL>
-    <UpdateURL>
       <URL>http://wb.mysql.com/installer/products.xml</URL>
     </UpdateURL>
   </UpdateURLs>


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110214154224-yfke7qx34xmi6604.bundle
Thread
bzr commit into wex-installer-1.0 branch (reggie.burnett:335) Reggie Burnett14 Feb