#At file:///C:/src/bzr.mysql/wex/mine/installer/ based on revid:iggy@stripped
207 Iggy Galarza 2010-09-24
- Added new Post remove options.
added:
WexInstaller/RemovePanels/
WexInstaller/RemovePanels/RemoveComplete.Designer.cs
WexInstaller/RemovePanels/RemoveComplete.cs
WexInstaller/RemovePanels/RemoveComplete.resx
WexInstaller/RemovePanels/RemoveProgress.Designer.cs
WexInstaller/RemovePanels/RemoveProgress.cs
WexInstaller/RemovePanels/RemoveProgress.resx
modified:
Setup_Net/Product.wxs
Setup_Net/config.xml
Setup_Web/Product.wxs
WexInstaller/Controls/InstallWizardControl.cs
WexInstaller/Core/Product.cs
WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs
WexInstaller/InstallWizard/InstallProgressPanel.cs
WexInstaller/InstallWizard/InstallType.cs
WexInstaller/InstallerConfiguration.cs
WexInstaller/MainForm.Designer.cs
WexInstaller/MainForm.cs
WexInstaller/Panels/InstallerPanel.cs
WexInstaller/WexInstaller.csproj
=== modified file 'Setup_Net/Product.wxs'
--- a/Setup_Net/Product.wxs 2010-09-13 17:17:02 +0000
+++ b/Setup_Net/Product.wxs 2010-09-24 21:01:12 +0000
@@ -46,6 +46,7 @@
<Component Id="Products" Guid="1A9B9234-EFCA-4DD6-A0A0-6227871517DF">
<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" />
<File Id="server" Name="mysql-essential-5.1.47-win32.msi" Source="ProductCache\mysql-essential-5.1.47-win32.msi"/>
<File Id="workbench" Name="mysql-workbench-oss-5.1.18a-win32.msi" Source="ProductCache\mysql-workbench-oss-5.1.18a-win32.msi"/>
<File Id="connector_odbc" Name="mysql-connector-c++-1.0.5-win32.msi" Source="ProductCache\mysql-connector-c++-1.0.5-win32.msi"/>
=== modified file 'Setup_Net/config.xml'
--- a/Setup_Net/config.xml 2010-09-13 17:17:02 +0000
+++ b/Setup_Net/config.xml 2010-09-24 21:01:12 +0000
@@ -10,4 +10,5 @@
<X>246</X>
<Y>84</Y>
</Location>
+ <ProductCode></ProductCode>
</Configuration>
\ No newline at end of file
=== modified file 'Setup_Web/Product.wxs'
--- a/Setup_Web/Product.wxs 2010-09-13 17:17:02 +0000
+++ b/Setup_Web/Product.wxs 2010-09-24 21:01:12 +0000
@@ -47,6 +47,7 @@
<CreateFolder Directory="ProductCache" />
<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" />
</Component>
</Directory>
</Directory>
=== modified file 'WexInstaller/Controls/InstallWizardControl.cs'
--- a/WexInstaller/Controls/InstallWizardControl.cs 2010-09-14 14:57:13 +0000
+++ b/WexInstaller/Controls/InstallWizardControl.cs 2010-09-24 21:01:12 +0000
@@ -5,8 +5,9 @@ using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
-using WexInstaller.Panels;
+using WexInstaller.Properties;
using WexInstaller.Core;
+using WexInstaller.Panels;
namespace WexInstaller
{
=== modified file 'WexInstaller/Core/Product.cs'
--- a/WexInstaller/Core/Product.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/Core/Product.cs 2010-09-24 21:01:12 +0000
@@ -199,7 +199,7 @@ namespace WexInstaller.Core
Logger.LogInformation(String.Format("{0}'s change state request passed.", Name));
GetPackage().UpdateOptionalParameters();
CurrentState += 1;
- Installed = true;
+ Installed = (CurrentState == ProductState.InstallSuccess || CurrentState == ProductState.UpdateSuccess);
}
else
{
=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs 2010-09-24 21:01:12 +0000
@@ -50,11 +50,11 @@
this.progressColumn,
this.notesColumn});
this.productList.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.productList.Location = new System.Drawing.Point(18, 113);
+ this.productList.Location = new System.Drawing.Point(17, 113);
this.productList.MultiSelect = false;
this.productList.Name = "productList";
this.productList.ShowGroups = false;
- this.productList.Size = new System.Drawing.Size(465, 227);
+ this.productList.Size = new System.Drawing.Size(513, 176);
this.productList.StateImageList = this.stateImages;
this.productList.TabIndex = 2;
this.productList.UseCompatibleStateImageBehavior = false;
@@ -107,7 +107,7 @@
//
this.subTitleLabel.AutoSize = true;
this.subTitleLabel.Font = new System.Drawing.Font("Tahoma", 9.75F);
- this.subTitleLabel.Location = new System.Drawing.Point(18, 75);
+ this.subTitleLabel.Location = new System.Drawing.Point(17, 75);
this.subTitleLabel.Name = "subTitleLabel";
this.subTitleLabel.Size = new System.Drawing.Size(234, 16);
this.subTitleLabel.TabIndex = 7;
@@ -116,7 +116,7 @@
// enableDetails
//
this.enableDetails.AutoSize = true;
- this.enableDetails.Location = new System.Drawing.Point(18, 356);
+ this.enableDetails.Location = new System.Drawing.Point(17, 298);
this.enableDetails.Name = "enableDetails";
this.enableDetails.Size = new System.Drawing.Size(89, 23);
this.enableDetails.TabIndex = 8;
@@ -128,12 +128,12 @@
// detailsText
//
this.detailsText.BackColor = System.Drawing.SystemColors.ControlLightLight;
- this.detailsText.Location = new System.Drawing.Point(18, 356);
+ this.detailsText.Location = new System.Drawing.Point(17, 298);
this.detailsText.Multiline = true;
this.detailsText.Name = "detailsText";
this.detailsText.ReadOnly = true;
this.detailsText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.detailsText.Size = new System.Drawing.Size(465, 143);
+ this.detailsText.Size = new System.Drawing.Size(513, 192);
this.detailsText.TabIndex = 9;
this.detailsText.Visible = false;
//
=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.cs 2010-09-24 21:01:12 +0000
@@ -48,8 +48,6 @@ namespace WexInstaller
public override void Activate()
{
- base.Activate();
-
productList.Items.Clear();
foreach (ProductCategory pc in ProductManager.ProductCategories)
{
@@ -73,6 +71,8 @@ namespace WexInstaller
NextButton.Text = "&Execute";
NextButton.Refresh();
}
+
+ base.Activate();
}
public override bool Next()
@@ -328,7 +328,7 @@ namespace WexInstaller
if (p.Name == "mysql-server")
{
AddToDetailsText(item.Index, "Adding Config pages");
- ParentControl.AddConfigPages();
+ (ParentControl as InstallWizardControl).AddConfigPages();
}
lock (installingItem)
{
=== modified file 'WexInstaller/InstallWizard/InstallType.cs'
--- a/WexInstaller/InstallWizard/InstallType.cs 2010-09-17 18:37:46 +0000
+++ b/WexInstaller/InstallWizard/InstallType.cs 2010-09-24 21:01:12 +0000
@@ -106,7 +106,7 @@ namespace WexInstaller
cat.SetInstallType(type);
}
- ParentControl.ShowFeatureSelection(customType.Checked == true);
+ (ParentControl as InstallWizardControl).ShowFeatureSelection(customType.Checked == true);
SignalChange();
}
=== modified file 'WexInstaller/InstallerConfiguration.cs'
--- a/WexInstaller/InstallerConfiguration.cs 2010-09-13 17:17:02 +0000
+++ b/WexInstaller/InstallerConfiguration.cs 2010-09-24 21:01:12 +0000
@@ -14,11 +14,6 @@ namespace WexInstaller
{
private static InstallerConfigurationData Instance = new InstallerConfigurationData();
- public InstallerConfiguration()
- {
- // Instance.ProductCachePath = String.Format("{0}\\Product Cache\\", HomeDir);
- }
-
#region Properties
public static bool DisplayLicenseAgreement
@@ -72,6 +67,12 @@ namespace WexInstaller
set { Instance.PreferredMirror = value; }
}
+ public static string ProductCode
+ {
+ get { return Instance.ProductCode; }
+ set { Instance.ProductCode = value; }
+ }
+
private static string ConfigFile
{
get { return String.Format("{0}\\config.xml", HomeDir); }
@@ -147,6 +148,7 @@ namespace WexInstaller
public string InstallationRoot { get; set; }
public int LicenseAgreement { get; set; }
public Point Location { get; set; }
+ public string ProductCode { get; set; }
}
internal static class SystemNativeMethods
=== modified file 'WexInstaller/MainForm.Designer.cs'
--- a/WexInstaller/MainForm.Designer.cs 2010-09-09 17:49:17 +0000
+++ b/WexInstaller/MainForm.Designer.cs 2010-09-24 21:01:12 +0000
@@ -33,6 +33,7 @@
this.resourcesPage = new WexInstaller.Controls.ResourcesPage();
this.aboutPage = new WexInstaller.Controls.AboutPage();
this.removeAllPage = new WexInstaller.RemoveAllPage();
+ this.removeControl = new WexInstaller.RemoveControl();
this.SuspendLayout();
//
// welcomeControl
@@ -86,6 +87,16 @@
this.removeAllPage.Size = new System.Drawing.Size(785, 561);
this.removeAllPage.TabIndex = 7;
//
+ // removeControl
+ //
+ this.removeControl.BackColor = System.Drawing.Color.White;
+ this.removeControl.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.removeControl.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.removeControl.Location = new System.Drawing.Point(0, 0);
+ this.removeControl.Name = "removeControl";
+ this.removeControl.Size = new System.Drawing.Size(785, 561);
+ this.removeControl.TabIndex = 8;
+ //
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -96,6 +107,7 @@
this.Controls.Add(this.resourcesPage);
this.Controls.Add(this.aboutPage);
this.Controls.Add(this.removeAllPage);
+ this.Controls.Add(this.removeControl);
this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
@@ -116,5 +128,6 @@
private Controls.ResourcesPage resourcesPage;
private Controls.AboutPage aboutPage;
private RemoveAllPage removeAllPage;
+ private RemoveControl removeControl;
}
}
\ No newline at end of file
=== modified file 'WexInstaller/MainForm.cs'
--- a/WexInstaller/MainForm.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/MainForm.cs 2010-09-24 21:01:12 +0000
@@ -53,7 +53,8 @@ namespace WexInstaller
Logger.LogTrace("MainForm.RemoveAll() called.");
last = welcomeControl;
- removeAllPage.BringToFront();
+ //removeAllPage.BringToFront();
+ removeControl.BringToFront();
}
public void GoBack()
=== modified file 'WexInstaller/Panels/InstallerPanel.cs'
--- a/WexInstaller/Panels/InstallerPanel.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/Panels/InstallerPanel.cs 2010-09-24 21:01:12 +0000
@@ -31,8 +31,8 @@ namespace WexInstaller
StatusChanged(this, EventArgs.Empty);
}
- private InstallWizardControl parentControl = null;
- protected InstallWizardControl ParentControl
+ private UserControl parentControl = null;
+ protected UserControl ParentControl
{
get
{
@@ -40,7 +40,7 @@ namespace WexInstaller
{
try
{
- parentControl = this.Parent.Parent.Parent as InstallWizardControl;
+ parentControl = this.Parent.Parent.Parent as UserControl;
}
catch
{
=== added directory 'WexInstaller/RemovePanels'
=== added file 'WexInstaller/RemovePanels/RemoveComplete.Designer.cs'
--- a/WexInstaller/RemovePanels/RemoveComplete.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/RemovePanels/RemoveComplete.Designer.cs 2010-09-24 21:01:12 +0000
@@ -0,0 +1,80 @@
+namespace WexInstaller
+{
+ partial class RemoveComplete
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.removeData = new System.Windows.Forms.CheckBox();
+ this.uninstallApp = new System.Windows.Forms.CheckBox();
+ this.SuspendLayout();
+ //
+ // removeData
+ //
+ this.removeData.AutoSize = true;
+ this.removeData.Enabled = false;
+ this.removeData.Location = new System.Drawing.Point(18, 101);
+ this.removeData.Name = "removeData";
+ this.removeData.Size = new System.Drawing.Size(147, 17);
+ this.removeData.TabIndex = 2;
+ this.removeData.Text = "Remove server datafiles.";
+ this.removeData.UseVisualStyleBackColor = true;
+ this.removeData.Visible = false;
+ //
+ // uninstallApp
+ //
+ this.uninstallApp.AutoSize = true;
+ this.uninstallApp.Enabled = false;
+ this.uninstallApp.Location = new System.Drawing.Point(18, 125);
+ this.uninstallApp.Name = "uninstallApp";
+ this.uninstallApp.Size = new System.Drawing.Size(214, 17);
+ this.uninstallApp.TabIndex = 3;
+ this.uninstallApp.Text = "Uninstall the MySQL Universal Installer.";
+ this.uninstallApp.UseVisualStyleBackColor = true;
+ this.uninstallApp.Visible = false;
+ //
+ // RemoveFinal
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Caption = "Clean existing data?";
+ this.Controls.Add(this.uninstallApp);
+ this.Controls.Add(this.removeData);
+ this.Name = "RemoveFinal";
+ this.Size = new System.Drawing.Size(560, 499);
+ this.Controls.SetChildIndex(this.removeData, 0);
+ this.Controls.SetChildIndex(this.uninstallApp, 0);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.CheckBox removeData;
+ private System.Windows.Forms.CheckBox uninstallApp;
+ }
+}
=== added file 'WexInstaller/RemovePanels/RemoveComplete.cs'
--- a/WexInstaller/RemovePanels/RemoveComplete.cs 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/RemovePanels/RemoveComplete.cs 2010-09-24 21:01:12 +0000
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using WexInstaller.Core;
+using System.Diagnostics;
+using System.IO;
+
+namespace WexInstaller
+{
+ public partial class RemoveComplete : InstallerPanel
+ {
+ private Product serverProduct;
+
+ public RemoveComplete()
+ {
+ InitializeComponent();
+ serverProduct = null;
+ }
+
+ public override void Activate()
+ {
+ if (NextButton != null)
+ {
+ NextButton.Text = "&Finish";
+ NextButton.Refresh();
+ }
+
+ int currentlyInstalled = 0;
+ foreach (ProductCategory pc in ProductManager.ProductCategories)
+ {
+ foreach (Product p in pc.Products)
+ {
+ if (p.Installed)
+ currentlyInstalled++;
+
+ if (p.Name == "mysql-server" && p.CurrentState == ProductState.RemoveSuccess)
+ {
+ removeData.Enabled = true;
+ removeData.Visible = true;
+ serverProduct = p;
+ }
+ }
+ }
+
+ if (currentlyInstalled == 0 && !String.IsNullOrEmpty(InstallerConfiguration.ProductCode))
+ {
+ uninstallApp.Visible = true;
+ uninstallApp.Enabled = true;
+ }
+
+ base.Activate();
+ }
+
+ public override bool Next()
+ {
+ if (removeData.Checked == true)
+ {
+ // Remove the datadirectory.
+ string dataDirectory = String.Empty;
+ serverProduct.GetPackage().RegistryEntries.TryGetValue("DataLocation", out dataDirectory);
+
+ if (!String.IsNullOrEmpty(dataDirectory) && Directory.Exists(dataDirectory))
+ {
+ Directory.Delete(dataDirectory, true);
+ }
+ }
+
+ if (uninstallApp.Checked == true)
+ {
+ // Uninstall the application
+ try
+ {
+ string commandLine = String.Format("/q /uninstall \"{0}\"", "{A467CA37-6305-4CE2-A8BD-B5270B0C3624}");
+
+ Process p = new Process();
+ p.StartInfo.FileName = "msiexec.exe";
+ p.StartInfo.Arguments = commandLine;
+ p.Start();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ return base.Next();
+ }
+ }
+}
=== added file 'WexInstaller/RemovePanels/RemoveComplete.resx'
--- a/WexInstaller/RemovePanels/RemoveComplete.resx 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/RemovePanels/RemoveComplete.resx 2010-09-24 21:01:12 +0000
@@ -0,0 +1,120 @@
+ï--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
=== added file 'WexInstaller/RemovePanels/RemoveProgress.Designer.cs'
--- a/WexInstaller/RemovePanels/RemoveProgress.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/RemovePanels/RemoveProgress.Designer.cs 2010-09-24 21:01:12 +0000
@@ -0,0 +1,127 @@
+namespace WexInstaller
+{
+ partial class RemoveProgress
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.enableDetails = new System.Windows.Forms.Button();
+ this.detailedLog = new System.Windows.Forms.TextBox();
+ this.packageListLabel = new System.Windows.Forms.Label();
+ this.productList = new System.Windows.Forms.ListView();
+ this.productHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.progressHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.SuspendLayout();
+ //
+ // enableDetails
+ //
+ this.enableDetails.AutoSize = true;
+ this.enableDetails.Location = new System.Drawing.Point(17, 298);
+ this.enableDetails.Name = "enableDetails";
+ this.enableDetails.Size = new System.Drawing.Size(89, 23);
+ this.enableDetails.TabIndex = 18;
+ this.enableDetails.Text = "&Show Details >";
+ this.enableDetails.UseVisualStyleBackColor = true;
+ this.enableDetails.Visible = false;
+ this.enableDetails.Click += new System.EventHandler(this.enableDetails_Click);
+ //
+ // detailedLog
+ //
+ this.detailedLog.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.detailedLog.Location = new System.Drawing.Point(17, 298);
+ this.detailedLog.Multiline = true;
+ this.detailedLog.Name = "detailedLog";
+ this.detailedLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.detailedLog.Size = new System.Drawing.Size(513, 192);
+ this.detailedLog.TabIndex = 17;
+ this.detailedLog.Visible = false;
+ //
+ // packageListLabel
+ //
+ this.packageListLabel.AutoSize = true;
+ this.packageListLabel.Font = new System.Drawing.Font("Tahoma", 10F);
+ this.packageListLabel.Location = new System.Drawing.Point(14, 81);
+ this.packageListLabel.Name = "packageListLabel";
+ this.packageListLabel.Size = new System.Drawing.Size(244, 17);
+ this.packageListLabel.TabIndex = 15;
+ this.packageListLabel.Text = "The following products will be removed";
+ //
+ // productList
+ //
+ this.productList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.productList.CheckBoxes = true;
+ this.productList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.productHeader,
+ this.progressHeader});
+ this.productList.Location = new System.Drawing.Point(17, 113);
+ this.productList.Name = "productList";
+ this.productList.Size = new System.Drawing.Size(513, 176);
+ this.productList.TabIndex = 16;
+ this.productList.UseCompatibleStateImageBehavior = false;
+ this.productList.View = System.Windows.Forms.View.Details;
+ this.productList.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.productList_ColumnClick);
+ //
+ // productHeader
+ //
+ this.productHeader.Text = " Product";
+ this.productHeader.Width = 443;
+ //
+ // progressHeader
+ //
+ this.progressHeader.Text = "Progress";
+ this.progressHeader.Width = 69;
+ //
+ // RemoveProgress
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Caption = "Remove Products";
+ this.Controls.Add(this.enableDetails);
+ this.Controls.Add(this.detailedLog);
+ this.Controls.Add(this.packageListLabel);
+ this.Controls.Add(this.productList);
+ this.Name = "RemoveProgress";
+ this.Size = new System.Drawing.Size(560, 499);
+ this.Load += new System.EventHandler(this.RemoveProgress_Load);
+ this.Controls.SetChildIndex(this.productList, 0);
+ this.Controls.SetChildIndex(this.packageListLabel, 0);
+ this.Controls.SetChildIndex(this.detailedLog, 0);
+ this.Controls.SetChildIndex(this.enableDetails, 0);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button enableDetails;
+ private System.Windows.Forms.TextBox detailedLog;
+ private System.Windows.Forms.Label packageListLabel;
+ private System.Windows.Forms.ListView productList;
+ private System.Windows.Forms.ColumnHeader productHeader;
+ private System.Windows.Forms.ColumnHeader progressHeader;
+ }
+}
=== added file 'WexInstaller/RemovePanels/RemoveProgress.cs'
--- a/WexInstaller/RemovePanels/RemoveProgress.cs 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/RemovePanels/RemoveProgress.cs 2010-09-24 21:01:12 +0000
@@ -0,0 +1,260 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using WexInstaller.Core;
+using WexInstaller.Properties;
+using System.Threading;
+
+namespace WexInstaller
+{
+ public partial class RemoveProgress : InstallerPanel
+ {
+ SolidBrush darkGrayBrush = new SolidBrush(Color.DarkGray);
+ Font titleFont = System.Drawing.SystemFonts.CaptionFont;
+
+ ListViewItem removingItem;
+ int start, stop, installStep, installPos;
+ int overall_progress;
+
+ private AutoResetEvent clearedToProceed;
+ private bool nextOk;
+ private bool backOk;
+ private bool executed;
+
+ public RemoveProgress()
+ {
+ InitializeComponent();
+
+ productList.Items.Clear();
+ foreach (ProductCategory pc in ProductManager.ProductCategories)
+ {
+ foreach (Product p in pc.Products)
+ {
+ if (p.Installed)
+ {
+ ListViewItem item = new ListViewItem(p.TitleWithVersion);
+ item.Name = p.Title;
+ item.Tag = p;
+ item.SubItems.Add(String.Empty);
+ item.SubItems.Add(String.Empty);
+ item.Checked = true;
+ productList.Items.Add(item);
+ }
+ }
+ }
+
+ clearedToProceed = new AutoResetEvent(true);
+ nextOk = false;
+ backOk = true;
+ executed = false;
+ }
+
+ private void ProductInstallationProgressChanged(object sender, ChainedInstallerEventArgs c)
+ {
+ switch (c.Action)
+ {
+ case ChainedInstallerAction.StartInstallation:
+ overall_progress = 0;
+ detailedLog.AppendText(String.Format("Begining removal of {0}.{1}", (sender as Product).Title, Environment.NewLine));
+ detailedLog.AppendText(String.Format("{0}{1}", c.Message, Environment.NewLine));
+ break;
+ case ChainedInstallerAction.HandleActionData:
+ detailedLog.AppendText(String.Format("{0}{1}", c.Message, Environment.NewLine));
+ break;
+ case ChainedInstallerAction.HandleActionStart:
+ detailedLog.AppendText(String.Format("{0}{1}", c.Message, Environment.NewLine));
+ break;
+ case ChainedInstallerAction.ProgressSetRange:
+ detailedLog.AppendText(String.Format("Min: {0} Max: {1}{2}", c.ProgressMin.ToString(), c.ProgressMax.ToString(), Environment.NewLine));
+ start = c.ProgressMin;
+ stop = c.ProgressMax;
+ installStep = 1;
+ installPos = 0;
+ if (overall_progress > 0)
+ overall_progress = 50;
+ break;
+ case ChainedInstallerAction.ProgressSetStep:
+ //detailedLog.AppendText(String.Format("Step: {0}{1}", c.ProgressStep.ToString(), Environment.NewLine));
+ installStep = c.ProgressStep;
+ break;
+ case ChainedInstallerAction.ProgressSetPosition:
+ //detailedLog.AppendText(String.Format("Position: {0}{1}", c.ProgressPosition.ToString(), Environment.NewLine));
+ if (c.ProgressPosition == stop && installPos == 0) return;
+ SetPosition(c.ProgressPosition);
+ break;
+ case ChainedInstallerAction.ProgressSingleStep:
+ SetPosition(installPos + installStep);
+ break;
+ case ChainedInstallerAction.EndInstallation:
+ detailedLog.AppendText(String.Format("{0}{1}", c.Message, Environment.NewLine));
+ break;
+ case ChainedInstallerAction.LogEvent:
+ detailedLog.AppendText(String.Format("{0}{1}", c.Message, Environment.NewLine));
+ break;
+ case ChainedInstallerAction.FinalAction:
+ Product p = (sender as Product);
+ if (c.ExitCode != 0)
+ {
+ detailedLog.AppendText(String.Format("The product {0} failed to remove successfully.{1}", p.Title, Environment.NewLine));
+ }
+ else
+ {
+ detailedLog.AppendText(String.Format("The product {0} was successfully removed.{1}", p.Title, Environment.NewLine));
+ }
+ detailedLog.AppendText(Environment.NewLine);
+
+ clearedToProceed.Set();
+
+ if (removingItem.Index == productList.Items.Count - 1)
+ {
+ nextOk = true;
+ backOk = false;
+ SignalChange();
+ }
+ break;
+ }
+ }
+
+ private void SetPosition(int newPos)
+ {
+ installPos = newPos;
+ float stagePos = (float)installPos / (float)(stop - start);
+ int progress = (int)(50.0f * stagePos);
+ if (overall_progress >= 50)
+ progress += 50;
+ overall_progress = Math.Max(overall_progress, progress);
+ removingItem.SubItems[1].Text = String.Format(Resources.StatusPercentage, overall_progress);
+ }
+
+ public override void Activate()
+ {
+ if (!executed)
+ {
+ NextButton.Text = "&Execute";
+ NextButton.Refresh();
+ }
+
+ base.Activate();
+ }
+
+ public override bool NextOk()
+ {
+ return nextOk;
+ }
+
+ public override bool BackOk()
+ {
+ return backOk;
+ }
+
+ public override bool Next()
+ {
+ if (!executed)
+ {
+ executed = true;
+
+ if (productList.CheckedItems.Count > 0)
+ {
+ DialogResult result = MessageBox.Show("Are you sure you wish to remove all listed products?", "Confirm Removal", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
+ if (result == DialogResult.Yes)
+ {
+ enableDetails.Visible = true;
+ nextOk = false;
+ NextButton.Enabled = false;
+
+ int totalRemaining = productList.CheckedItems.Count;
+ while (totalRemaining > 0)
+ {
+ if (clearedToProceed.WaitOne(1))
+ {
+ totalRemaining = productList.CheckedItems.Count;
+ foreach (ListViewItem item in productList.CheckedItems)
+ {
+ Product p = (item.Tag as Product);
+ ProductState state = p.CurrentState;
+ if (p.CurrentState == ProductState.RemoveStarted ||
+ p.CurrentState == ProductState.RemoveInProgress)
+ {
+ continue;
+ }
+
+ if (p.CurrentState == ProductState.InstallSuccess ||
+ p.CurrentState == ProductState.CurrentlyInstalled)
+ {
+ clearedToProceed.Reset();
+ removingItem = item;
+ p.ProductInstallationProgressChanged += new ProductInstationActionEventHandler(ProductInstallationProgressChanged);
+ p.Remove();
+ totalRemaining--;
+ break;
+ }
+ else
+ {
+ totalRemaining--;
+ }
+ }
+ }
+ Application.DoEvents();
+ Thread.Sleep(0);
+ }
+
+ NextButton.Text = "&Next >";
+ NextButton.Enabled = true;
+ nextOk = true;
+ NextButton.Refresh();
+ SignalChange();
+ }
+ }
+ else
+ {
+ nextOk = false;
+ backOk = true;
+ NextButton.Enabled = false;
+ BackButton.Enabled = true;
+ MessageBox.Show("No products selected for removal at this time.", "Nothing to do", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ SignalChange();
+ }
+
+ return false;
+ }
+ return base.Next();
+ }
+
+ private void productList_ColumnClick(object sender, ColumnClickEventArgs e)
+ {
+ switch (e.Column)
+ {
+ case 0:
+ ListView l = sender as ListView;
+ foreach (ListViewItem li in l.Items)
+ {
+ li.Checked = !li.Checked;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void enableDetails_Click(object sender, EventArgs e)
+ {
+ enableDetails.Visible = false;
+ detailedLog.Visible = true;
+ detailedLog.BringToFront();
+ }
+
+ private void RemoveProgress_Load(object sender, EventArgs e)
+ {
+ if (NextButton != null)
+ {
+ NextButton.Text = "&Execute";
+ NextButton.Refresh();
+ }
+ }
+ }
+}
=== added file 'WexInstaller/RemovePanels/RemoveProgress.resx'
--- a/WexInstaller/RemovePanels/RemoveProgress.resx 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/RemovePanels/RemoveProgress.resx 2010-09-24 21:01:12 +0000
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
=== modified file 'WexInstaller/WexInstaller.csproj'
--- a/WexInstaller/WexInstaller.csproj 2010-09-22 22:25:30 +0000
+++ b/WexInstaller/WexInstaller.csproj 2010-09-24 21:01:12 +0000
@@ -96,6 +96,12 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ListViewHelper.cs" />
+ <Compile Include="Controls\RemoveControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Controls\RemoveControl.Designer.cs">
+ <DependentUpon>RemoveControl.cs</DependentUpon>
+ </Compile>
<Compile Include="Controls\ResourcesLink.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -252,6 +258,18 @@
<Compile Include="Controls\WelcomeControl.Designer.cs">
<DependentUpon>WelcomeControl.cs</DependentUpon>
</Compile>
+ <Compile Include="RemovePanels\RemoveComplete.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="RemovePanels\RemoveComplete.Designer.cs">
+ <DependentUpon>RemoveComplete.cs</DependentUpon>
+ </Compile>
+ <Compile Include="RemovePanels\RemoveProgress.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="RemovePanels\RemoveProgress.Designer.cs">
+ <DependentUpon>RemoveProgress.cs</DependentUpon>
+ </Compile>
<Compile Include="UnitTests\FormulaEngineTest.cs" />
<Compile Include="UnitTests\IniTemplateTest.cs" />
<Compile Include="UnitTests\MultiCoreTest.cs" />
@@ -271,6 +289,9 @@
<EmbeddedResource Include="Controls\FeatureBox.resx">
<DependentUpon>FeatureBox.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Controls\RemoveControl.resx">
+ <DependentUpon>RemoveControl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Controls\ResourcesLink.resx">
<DependentUpon>ResourcesLink.cs</DependentUpon>
</EmbeddedResource>
@@ -347,6 +368,12 @@
<EmbeddedResource Include="Controls\WelcomeControl.resx">
<DependentUpon>WelcomeControl.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="RemovePanels\RemoveComplete.resx">
+ <DependentUpon>RemoveComplete.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="RemovePanels\RemoveProgress.resx">
+ <DependentUpon>RemoveProgress.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="UnitTests\SimpleProgressBar.resx">
<DependentUpon>SimpleProgressBar.cs</DependentUpon>
</EmbeddedResource>
Attachment: [text/bzr-bundle] bzr/iggy@mysql.com-20100924210112-x4dp6u0p39b74d02.bundle
| Thread |
|---|
| • bzr commit into wex-installer-1.0 branch (iggy:207) | Iggy Galarza | 24 Sep |