List:Commits« Previous MessageNext Message »
From:Iggy Galarza Date:October 1 2010 1:46pm
Subject:bzr commit into wex-installer-1.0 branch (iggy:211)
View as plain text  
#At file:///C:/src/bzr.mysql/wex/mine/installer/ based on revid:iggy@stripped

  211 Iggy Galarza	2010-10-01
      - Fixed some untimely enabling of buttons.

    modified:
      WexInstaller/InstallWizard/InstallProgressPanel.cs
      WexInstaller/RemovePanels/RemoveProgress.cs
      WexInstaller/UnitTests/MultiCoreTest.cs
=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.cs	2010-09-24 21:01:12 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.cs	2010-10-01 13:46:31 +0000
@@ -247,13 +247,18 @@ namespace WexInstaller
 
         private void InstallNextPackage()
         {
-            leftToInstall = productList.Items.Count;
-
-            while (leftToInstall > 0)
+            do
             {
+                leftToInstall = productList.Items.Count;
                 foreach (ListViewItem item in productList.Items)
                 {
                     Product p = (Product)item.Tag;
+                    if (p.CurrentState == ProductState.InstallInProgress ||
+                        p.CurrentState == ProductState.UpdateInProgress ||
+                        p.CurrentState == ProductState.RemoveInProgress)
+                    {
+                        continue;
+                    }
                     if (p.CurrentState != ProductState.DownloadSuccess &&
                         p.CurrentState != ProductState.FoundLocal &&
                         p.CurrentState != ProductState.WillPerformUpgrade)
@@ -269,6 +274,7 @@ namespace WexInstaller
                 Application.DoEvents();
                 Thread.Sleep(0);
             }
+            while (leftToInstall > 0);
 
             nextOk = true;
             NextButton.Enabled = true;

=== modified file 'WexInstaller/RemovePanels/RemoveProgress.cs'
--- a/WexInstaller/RemovePanels/RemoveProgress.cs	2010-09-24 21:01:12 +0000
+++ b/WexInstaller/RemovePanels/RemoveProgress.cs	2010-10-01 13:46:31 +0000
@@ -166,6 +166,7 @@ namespace WexInstaller
                         enableDetails.Visible = true;
                         nextOk = false;
                         NextButton.Enabled = false;
+                        SignalChange();
 
                         int totalRemaining = productList.CheckedItems.Count;
                         while (totalRemaining > 0)
@@ -203,10 +204,15 @@ namespace WexInstaller
                             Thread.Sleep(0);
                         }
 
+                        while (!clearedToProceed.WaitOne(1))
+                        {
+                            Application.DoEvents();
+                        }
+
                         NextButton.Text = "&Next >";
                         NextButton.Enabled = true;
-                        nextOk = true;
                         NextButton.Refresh();
+                        nextOk = true;
                         SignalChange();
                     }
                 }

=== modified file 'WexInstaller/UnitTests/MultiCoreTest.cs'
--- a/WexInstaller/UnitTests/MultiCoreTest.cs	2010-09-09 17:49:17 +0000
+++ b/WexInstaller/UnitTests/MultiCoreTest.cs	2010-10-01 13:46:31 +0000
@@ -37,14 +37,14 @@ namespace WexInstaller.UnitTests
             return success;
         }
 
-        [SetUp]
+        //[SetUp]
         public void SetUp()
         {
             // Install the Universal Installer.
             uint[] returnCodes = null;
             ChainedInstaller i = new ChainedInstaller();
             PackageParameters parameters = new PackageParameters(
-                System.IO.Path.GetFullPath("..\\..\\..\\Setup_Web\\bin\\Release\\mysql-universal-installer-alpha8-web.msi"),  // The installers are only built for release builds.
+                System.IO.Path.GetFullPath("..\\..\\..\\Setup_Web\\bin\\Release\\mysql-universal-installer-alpha14-web.msi"),  // The installers are only built for release builds.
                 InstallAction.Install);
 
             i.AddPackage(parameters);
@@ -55,14 +55,14 @@ namespace WexInstaller.UnitTests
             Assert.That(FindAndKillProcess("UnifiedInstaller"));
         }
 
-        [TearDown]
+        //[TearDown]
         public void TearDown()
         {
             // Un-install the Unified Installer.
             uint[] returnCodes = null;
             ChainedInstaller i = new ChainedInstaller();
             PackageParameters parameters = new PackageParameters(
-                System.IO.Path.GetFullPath("..\\..\\..\\Setup_Web\\bin\\Release\\mysql-universal-installer-alpha5-web.msi"),  // The installers are only built for release builds.
+                System.IO.Path.GetFullPath("..\\..\\..\\Setup_Web\\bin\\Release\\mysql-universal-installer-alpha14-web.msi"),  // The installers are only built for release builds.
                 InstallAction.Uninstall);
 
             i.AddPackage(parameters);
@@ -92,8 +92,7 @@ namespace WexInstaller.UnitTests
             form = new MainForm();
             form.Show();
 
-            next = (Button)form.Controls.Find("welcomeControl", false)[0].Controls.Find("nextBtn", false)[0];
-            next.PerformClick();
+            form.DoInstall();
 
             htc = (HiddenTabsControl)form.Controls.Find("installWizardControl", false)[0].Controls.Find("wizardPages", false)[0];
             next = (Button)form.Controls.Find("installWizardControl", false)[0].Controls.Find("Next", false)[0];
@@ -124,11 +123,10 @@ namespace WexInstaller.UnitTests
             }
 
             // Ready to Install
-            
-
+            Assert.AreEqual(htc.SelectedTab.Name, "installProgressTab");
             EventHandler eh = new EventHandler(WaitEventHandler);
-            next.EnabledChanged += eh;
             next.PerformClick();
+            next.EnabledChanged += eh;
             do
             {
                 Application.DoEvents();
@@ -137,20 +135,21 @@ namespace WexInstaller.UnitTests
 
             next.EnabledChanged -= eh;
             uiSignalEvent.Reset();
+            next.PerformClick();
 
             // ServerConfigurationScreen1
             next.PerformClick();
-            //next.PerformClick();
 
             // ServerConfigurationScreen2
             // Enable IP (default PORT)
-            cb = (CheckBox)htc.SelectedTab.Controls.Find("serverErrorSign", false)[0].Controls.Find("enableTCPIP", false)[0];
+            InstallerPanel ip = (InstallerPanel)htc.SelectedTab.Controls.Find("ServerConfigStep2", false)[0];
+            cb = (CheckBox)ip.Controls.Find("enableTCPIP", false)[0];
             cb.Checked = true;
 
             // Set both root passwords.
-            TextBox tb = (TextBox)htc.SelectedTab.Controls.Find("serverErrorSign", false)[0].Controls.Find("rootPassword", false)[0];
+            TextBox tb = (TextBox)ip.Controls.Find("rootPassword", false)[0];
             tb.Text = "root";
-            tb = (TextBox)htc.SelectedTab.Controls.Find("serverErrorSign", false)[0].Controls.Find("rootPasswordRepeat", false)[0];
+            tb = (TextBox)ip.Controls.Find("rootPasswordRepeat", false)[0];
             tb.Text = "root";
             next.PerformClick();
 
@@ -158,24 +157,13 @@ namespace WexInstaller.UnitTests
             next.PerformClick();
 
             // ServerConfigurationScreen4
-            next.EnabledChanged += eh;
-
-            next.PerformClick();
-            do
-            {
-                Application.DoEvents();
-            }
-            while (uiSignalEvent.WaitOne(10000) != true);
-
-            next.EnabledChanged -= eh;
             next.PerformClick();
 
             // Clicke the Finish button.
+            // Uncheck Launch WB.
             next.PerformClick();
 
             InstallerConfiguration.Save();
-
-            uiSignalEvent.Reset();
             form.Disposed += new EventHandler(WaitEventHandler);
             form.Dispose();
             do
@@ -199,12 +187,18 @@ namespace WexInstaller.UnitTests
             // 'Click' the Remove All Products Link.
             form.RemoveAll();
 
+            // Basic controls.
+            htc = (HiddenTabsControl)form.Controls.Find("removeControl", false)[0].Controls.Find("wizardPages", false)[0];
+            next = (Button)form.Controls.Find("removeControl", false)[0].Controls.Find("Next", false)[0];
+
             // Start removal.
-            next = (Button)form.Controls.Find("removeAllPage", false)[0].Controls.Find("startOrCloseButton", false)[0];
-            Button cancel = (Button)form.Controls.Find("removeAllPage", false)[0].Controls.Find("closeButton", false)[0];
-            cancel.VisibleChanged += new EventHandler(WaitEventHandler);
+            Assert.AreEqual(htc.SelectedTab.Name, "removeProgressTab");
+
+            next.PerformClick();
 
             uiSignalEvent.Reset();
+            EventHandler eh = new EventHandler(WaitEventHandler);
+            next.TextChanged += eh;
             next.PerformClick();
             do
             {
@@ -212,14 +206,27 @@ namespace WexInstaller.UnitTests
             }
             while (uiSignalEvent.WaitOne(10000) != true);
 
-            // Close the form.  Cancel button executes Application.Exit causing problems with test suite.
-            form.Close();
+            next.EnabledChanged -= eh;
+            Thread.Sleep(5); // Breif pause to allow next button to ready itself.
+            next.PerformClick();
 
-            string serverDataPath = Path.GetDirectoryName(String.Format("{0}\\..\\MySQL Server 5.1\\", InstallerConfiguration.HomeDir));
-            if (Directory.Exists(serverDataPath))
+            Assert.AreEqual(htc.SelectedTab.Name, "removeFinalTab");
+            try
             {
-                Directory.Delete(serverDataPath, true);
+                CheckBox cb = (CheckBox)htc.SelectedTab.Controls.Find("removeFinalPanel", false)[0].Controls.Find("removeData", false)[0];
+                cb.Checked = true;
             }
+            catch (Exception e)
+            {
+                // If the control isn't present, no worries.
+            }
+            next.PerformClick();
+
+            //string serverDataPath = Path.GetDirectoryName(String.Format("{0}\\..\\MySQL Server 5.1\\", InstallerConfiguration.HomeDir));
+            //if (Directory.Exists(serverDataPath))
+            //{
+            //    Directory.Delete(serverDataPath, true);
+            //}
         }
     }
 }


Attachment: [text/bzr-bundle] bzr/iggy@mysql.com-20101001134631-y0ck0od0qq3oow04.bundle
Thread
bzr commit into wex-installer-1.0 branch (iggy:211) Iggy Galarza1 Oct