#At file:///C:/Users/Reggie/work/wex/installer-updated/ based on revid:iggy@strippedk9p
306 Reggie Burnett 2011-02-07
split server product configuration out into the StandardPlugins assembly and formalized the plugin system
added:
StandardPlugins/
StandardPlugins/ConfigurationController.cs
StandardPlugins/IniTemplate.cs
StandardPlugins/MysqlSCM.cs
StandardPlugins/Properties/
StandardPlugins/Properties/AssemblyInfo.cs
StandardPlugins/Properties/Resources.Designer.cs
StandardPlugins/Properties/Resources.resx
StandardPlugins/Resources/
StandardPlugins/Resources/ActionCurrent.png
StandardPlugins/Resources/ActionDone.png
StandardPlugins/Resources/ActionError.png
StandardPlugins/Resources/ActionOpen.png
StandardPlugins/Resources/ActionWarning.png
StandardPlugins/Resources/dedicated_machine.png
StandardPlugins/Resources/dev_machine.png
StandardPlugins/Resources/fading_divider.png
StandardPlugins/Resources/server-confirm.JPG
StandardPlugins/Resources/server_config_networking.png
StandardPlugins/Resources/server_config_security.png
StandardPlugins/Resources/server_config_windows.png
StandardPlugins/Resources/server_machine.png
StandardPlugins/Resources/warning_sign.png
StandardPlugins/ServerConfigPanel1.Designer.cs
StandardPlugins/ServerConfigPanel1.cs
StandardPlugins/ServerConfigPanel1.resx
StandardPlugins/ServerConfigPanel2.Designer.cs
StandardPlugins/ServerConfigPanel2.cs
StandardPlugins/ServerConfigPanel2.resx
StandardPlugins/ServerConfigPanel3.Designer.cs
StandardPlugins/ServerConfigPanel3.cs
StandardPlugins/ServerConfigPanel3.resx
StandardPlugins/ServerConfigPanel4.Designer.cs
StandardPlugins/ServerConfigPanel4.cs
StandardPlugins/ServerConfigPanel4.resx
StandardPlugins/ServerConfigPanel5.Designer.cs
StandardPlugins/ServerConfigPanel5.cs
StandardPlugins/ServerConfigPanel5.resx
StandardPlugins/StandardPlugins.csproj
WexInstaller/Core/PluginManager.cs
renamed:
WexInstaller/Panels/ProductConfigurationController.cs => WexInstaller/Core/ProductConfigurationController.cs
modified:
WexInstaller/Core/Product.cs
WexInstaller/Core/ProductManager.cs
WexInstaller/InstallWizard/AllConfigOverview.cs
WexInstaller/InstallWizard/DetailedUpdateCheck.Designer.cs
WexInstaller/InstallWizard/UpdateCheck.Designer.cs
WexInstaller/InstallerConfiguration.cs
WexInstaller/Properties/Resources.resx
WexInstaller/WexInstaller.csproj
installer-vs2010.sln
WexInstaller/Core/ProductConfigurationController.cs
=== added directory 'StandardPlugins'
=== added file 'StandardPlugins/ConfigurationController.cs'
=== added directory 'StandardPlugins'
=== added file 'StandardPlugins/ConfigurationController.cs'
--- a/StandardPlugins/ConfigurationController.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ConfigurationController.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,472 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Windows.Forms;
+using WexInstaller.Core;
+using MySql.Data;
+using MySql.Data.MySqlClient;
+using System.ComponentModel;
+using System.Threading;
+using System.Diagnostics;
+
+namespace WexInstaller.Plugins
+{
+ [ProductConfiguration("mysql-server", 1)]
+ public class ServerConfigurationController : ProductConfigurationController
+ {
+ private BackgroundWorker bgw;
+ private UserControl[] pages;
+ private bool processedTemplate;
+ private bool processedService;
+ private bool processedSecuritySettings;
+
+ public IniTemplate it { get; set; }
+ public MySQLServiceControlManager mysql_scm { get; set; }
+
+ // UI Controls.
+ public ServerInstallType ServerInstallType { get; set; }
+ public bool Reconfigure { get; set; }
+ public bool EnableTCPIP { get; set; }
+ public int Port { get; set; }
+ public bool CreateService { get; set; }
+ public string ServiceName { get; set; }
+ public bool StartAtStartup { get; set; }
+ public string RootPassword { get; set; }
+ public string ExistingRootPassword { get; set; }
+ public string ExistingConfigFile { get; set; }
+
+ public ServerConfigurationController()
+ {
+ CurrentState = ConfigState.ConfigurationRequired;
+ Logger.LogInformation("Product configuration controller created.");
+ Initalize();
+
+ processedTemplate = false;
+ processedService = false;
+ processedSecuritySettings = false;
+ }
+
+ public override UserControl[] Pages
+ {
+ get
+ {
+ GetPages();
+ return pages;
+ }
+ }
+
+ public override int NumPages
+ {
+ get { return (Reconfigure) ? 1 : 2; }
+ }
+
+ public override void Configure()
+ {
+ CurrentState = ConfigState.ConfigurationInProgress;
+ Debug.Assert(bgw == null);
+ bgw = new BackgroundWorker();
+ bgw.WorkerReportsProgress = true;
+ bgw.WorkerSupportsCancellation = false;
+ bgw.DoWork += new DoWorkEventHandler(bgw_DoConfigure);
+ bgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_ConfigureCompleted);
+ bgw.ProgressChanged += new ProgressChangedEventHandler(bgw_ConfigureProgressChanged);
+ bgw.RunWorkerAsync();
+ }
+
+ private bool ProcessTemplate()
+ {
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "VALID_TEMPLATE"));
+ if (it.IsValid)
+ {
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "VALID_TEMPLATE"));
+
+ switch (ServerInstallType)
+ {
+ case ServerInstallType.Dedicated:
+ it.ServerType = IniServerType.Dedicated;
+ break;
+ case ServerInstallType.Developer:
+ it.ServerType = IniServerType.Developer;
+ break;
+ case ServerInstallType.Server:
+ it.ServerType = IniServerType.Server;
+ break;
+ }
+
+ // Set reasonable defaults.
+ it.MyisamUsage = 0.05;
+ it.SkipInnodb = false;
+ it.DefaultStorageEngine = "INNODB";
+ it.DefaultCharacterSet = "utf8";
+ it.NumberConnections = 20.0;
+ it.UseQueryCache = 0.0;
+ it.InnoDBBPSUsage = 0.50;
+
+ if (EnableTCPIP)
+ {
+ it.EnableNetworking = true;
+ it.Port = Port.ToString();
+ }
+
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "PROCESS_TEMPLATE"));
+ it.ProcessTemplate();
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "PROCESS_TEMPLATE"));
+ processedTemplate = true;
+ }
+ else
+ {
+ // Bad Template. Error.
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "VALID_TEMPLATE"));
+
+ processedTemplate = false;
+ }
+
+ return processedTemplate;
+ }
+
+ private bool ProcessService()
+ {
+ try
+ {
+ string thisServiceName = mysql_scm.FindServiceName(it.BaseDir);
+
+ if (thisServiceName.Length > 0)
+ //if (it.Reconfiguring)
+ {
+ // Make sure the existing server uses the new configuration file, then
+ // start it.
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
+ mysql_scm.Update(thisServiceName,
+ String.Format("\"{0}bin\\mysqld\" --defaults-file=\"{1}\" {2}",
+ it.BaseDir, it.ConfigurationFile, thisServiceName));
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
+
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
+ mysql_scm.Restart(thisServiceName);
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
+ }
+ else
+ {
+ // Add and Start the service.
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
+ mysql_scm.Add(ServiceName, ServiceName,
+ String.Format("\"{0}bin\\mysqld\" --defaults-file=\"{1}\" {2}", it.BaseDir, it.ConfigurationFile, ServiceName));
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
+
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
+ mysql_scm.Start(ServiceName);
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
+
+ processedService = false;
+ }
+
+ processedService = true;
+ }
+ catch
+ {
+ // Failed to add or start the server
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "CONFIGURE_SERVICE"));
+ }
+
+ return processedService;
+ }
+
+ private bool ProcessSecuritySettings()
+ {
+ try
+ {
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "SECURITY_SETTING"));
+
+ // Set root password.
+ MySqlCommand cmd = new MySqlCommand();
+ string connectionString = String.Format("server=localhost;user id=root;port={0};database=mysql;", it.Port);
+
+ if (String.IsNullOrEmpty(ExistingRootPassword) == false)
+ {
+ connectionString += String.Format("password={0}", ExistingRootPassword);
+ }
+ cmd.Connection = new MySqlConnection(connectionString);
+ cmd.Connection.Open();
+ cmd.CommandText = String.Format("UPDATE mysql.user SET Password=Password('{0}') WHERE User='root'", RootPassword);
+ cmd.ExecuteNonQuery();
+ cmd.CommandText = "FLUSH PRIVILEGES";
+ cmd.ExecuteNonQuery();
+ cmd.Connection.Close();
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "SECURITY_SETTING"));
+
+ processedSecuritySettings = true;
+ }
+ catch (MySqlException)
+ {
+ // Failed to set root password.
+ OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "SECURITY_SETTING"));
+ processedSecuritySettings = false;
+ }
+
+ return processedSecuritySettings;
+ }
+
+ private void bgw_DoConfigure(object sender, DoWorkEventArgs e)
+ {
+ if (it == null)
+ Initalize();
+
+ Logger.LogInformation("Beginning product configuration.");
+ if (ProcessTemplate())
+ {
+ if (this.CreateService == true)
+ {
+ if (ProcessService())
+ {
+ ProcessSecuritySettings();
+ }
+ }
+ }
+ }
+
+ private void bgw_ConfigureProgressChanged(object sender, ProgressChangedEventArgs e)
+ {
+ if (Configured != null)
+ Configured(this, e.UserState as ConfigurationEventArgs);
+ }
+
+ private void bgw_ConfigureCompleted(object sender, RunWorkerCompletedEventArgs e)
+ {
+ bgw.Dispose();
+ bgw = null;
+ if (CurrentState != ConfigState.ConfigurationError)
+ CurrentState = ConfigState.ConfigurationComplete;
+ if (Configured != null)
+ {
+ ConfigurationEventArgs ce = new ConfigurationEventArgs(ConfigurationEventType.Finished, "CONFIGURE_COMPLETE");
+ ce.PercentComplete = 100;
+ ce.Details = "Product configuration controller finished configuration.";
+ Configured(this, ce);
+ }
+ return;
+ }
+
+ public override void Initalize()
+ {
+ Logger.LogInformation("Product configuration controller initialization started.");
+
+ if (mysql_scm == null)
+ mysql_scm = new MySQLServiceControlManager();
+
+ string baseDirectory = String.Empty;
+ string dataDirectory = String.Empty;
+ string foundDataDir = String.Empty;
+ string version = String.Empty;
+
+ if (Owner != null)
+ {
+ if (Owner.Installed)
+ {
+ Logger.LogInformation(String.Format("Product configuration controller found {0} installed.", Owner.Name));
+
+ baseDirectory = Owner.GetInstalledProductRegistryKey("Location");
+ dataDirectory = Owner.GetInstalledProductRegistryKey("DataLocation");
+ foundDataDir = Owner.GetInstalledProductRegistryKey("FoundExistingDataDir");
+ version = Owner.GetInstalledProductRegistryKey("Version");
+
+ if (!String.IsNullOrEmpty(baseDirectory))
+ {
+ // Look for existing service.
+ this.ServiceName = mysql_scm.FindServiceName(baseDirectory);
+ }
+
+ if (String.IsNullOrEmpty(this.ServiceName) && !String.IsNullOrEmpty(version))
+ {
+ // If no existing service, use default.
+ this.ServiceName = String.Format("MySQL{0}{1}", version[0], version[2]);
+ }
+ }
+
+ Reconfigure = (Owner.IsUpgrade && Owner.Installed);
+ if (Reconfigure)
+ {
+ Regex defaultsFilePattern = new Regex(@" --defaults-file=""(?<iniLocation>.+)?"" ");
+ Match m = defaultsFilePattern.Match(mysql_scm.BinaryPath(ServiceName));
+ if (m.Success)
+ {
+ ExistingConfigFile = Path.GetFullPath(m.Groups["iniLocation"].Value);
+ string destination = String.Format("{0}{1}", dataDirectory, Path.GetFileName(ExistingConfigFile));
+ try
+ {
+ File.Copy(ExistingConfigFile, destination);
+ }
+ catch
+ {
+ }
+ }
+ }
+ }
+
+ if (!String.IsNullOrEmpty(baseDirectory) && !String.IsNullOrEmpty(dataDirectory))
+ {
+ Logger.LogInformation("Product configuration controller creating new template instance.");
+
+ it = new IniTemplate(baseDirectory, dataDirectory, InstallerConfiguration.TemplateName, dataDirectory);
+ it.FoundExistingDataDir = (!String.IsNullOrEmpty(foundDataDir) && foundDataDir == "1");
+ }
+ else
+ {
+ Logger.LogInformation("Product not currently installed.");
+
+ it = null;
+ }
+ }
+
+ private void GetPages()
+ {
+ if (pages != null) return;
+ pages = new UserControl[NumPages];
+
+ if (Reconfigure)
+ {
+ Logger.LogInformation("Setting up product configuration controller for reconfiguration.");
+ pages[0]= new ServerConfigStep1a(this);
+ }
+ else
+ {
+ Logger.LogInformation("Setting up product configuration controller for new installation.");
+ pages[0] = new ServerConfigStep1(this);
+ pages[1] = new ServerConfigStep2(this);
+ // pages[2] = new ServerConfigStep3(this);
+ // pages[3] = new ServerConfigAction(this);
+ }
+ }
+
+ private string GetServerTypeAsString()
+ {
+ if (ServerInstallType == ServerInstallType.Developer)
+ return "Development Machine";
+ else if (ServerInstallType == ServerInstallType.Server)
+ return "Server Machine";
+ else
+ return "Dedicated Machine";
+ }
+
+ public string GetConfigurationAsText()
+ {
+ StringBuilder s = new StringBuilder();
+ s.AppendLine("Configuration Type");
+ s.AppendLine(String.Format(" {0}", GetServerTypeAsString()));
+ s.AppendLine(String.Format("TCP/IP Networking {0}", EnableTCPIP ? "enabled" : "disabled"));
+ s.AppendLine(String.Format(" Port: {0}", EnableTCPIP ? Port.ToString() : "N/A"));
+ s.AppendLine("Windows Settings");
+ s.AppendLine(String.Format(" Windows Service Name: {0}",
+ String.IsNullOrEmpty(ServiceName) ? "<Not Set>" : ServiceName));
+ s.AppendLine("Security Settings");
+ s.AppendLine(String.Format(" Root Password {0}Set",
+ String.IsNullOrEmpty(RootPassword) ? "Not " : ""));
+ return s.ToString();
+ }
+
+ public event ConfigurationEventHandler Configured;
+
+ protected virtual void OnConfigured(ConfigurationEventArgs e)
+ {
+ string message = String.Empty;
+ int percent = 100 / 11;
+
+ switch (e.Type)
+ {
+ case (ConfigurationEventType.Info):
+ switch (e.Action)
+ {
+ case "VALID_TEMPLATE":
+ message = "Looking for valid template.";
+ percent *= 1;
+ break;
+ case "PROCESS_TEMPLATE":
+ percent *= 3;
+ message = "Attempting to process template.";
+ break;
+ case "CONFIGURE_SERVICE":
+ percent *= 5;
+ message = "Attempting to configure service.";
+ break;
+ case "START_SERVICE":
+ percent *= 7;
+ message = "Attempting to start service.";
+ break;
+ case "SECURITY_SETTING":
+ percent *= 9;
+ message = "Attempting to update security settings.";
+ break;
+ }
+ Logger.LogInformation(message);
+ break;
+ case (ConfigurationEventType.Success):
+ switch (e.Action)
+ {
+ case "VALID_TEMPLATE":
+ percent *= 2;
+ message = "Found valid template.";
+ break;
+ case "PROCESS_TEMPLATE":
+ percent *= 4;
+ message = "Processed template.";
+ break;
+ case "CONFIGURE_SERVICE":
+ percent *= 6;
+ message = "Configured service.";
+ break;
+ case "START_SERVICE":
+ percent *= 8;
+ message = "Started service.";
+ break;
+ case "SECURITY_SETTING":
+ percent *= 10;
+ message = "Updated security settings.";
+ break;
+ }
+ Logger.LogInformation(message);
+ break;
+ case (ConfigurationEventType.Error):
+ switch (e.Action)
+ {
+ case "VALID_TEMPLATE":
+ message = "Unable to find a valid template.";
+ break;
+ case "PROCESS_TEMPLATE":
+ message = "Failed to process template.";
+ break;
+ case "CONFIGURE_SERVICE":
+ message = "Unable to configure service.";
+ break;
+ case "START_SERVICE":
+ message = "Failed to start service.";
+ break;
+ case "SECURITY_SETTING":
+ message = "Unable to update security settings.";
+ break;
+ }
+ percent *= 11;
+ CurrentState = ConfigState.ConfigurationError;
+ Logger.LogError(message);
+ break;
+ case (ConfigurationEventType.Finished):
+ message = "Product configuration controller finished configuration.";
+ percent *= 11;
+ CurrentState = ConfigState.ConfigurationComplete;
+ Logger.LogInformation(message);
+ break;
+ };
+ e.Details = message;
+ e.PercentComplete = percent;
+
+ bgw.ReportProgress(percent, e);
+ }
+ }
+
+ public enum ServerInstallType
+ {
+ Developer,
+ Server,
+ Dedicated
+ }
+}
=== added file 'StandardPlugins/IniTemplate.cs'
--- a/StandardPlugins/IniTemplate.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/IniTemplate.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,1172 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace WexInstaller.Core
+{
+ public class IniTemplateStatic
+ {
+ protected string line_as_read;
+
+ public IniTemplateStatic(string input)
+ {
+ line_as_read = input;
+ }
+
+ public string LineAsRead
+ {
+ get { return line_as_read; }
+ }
+ }
+
+ public class IniTemplateVariable : IniTemplateStatic
+ {
+ private string variable_name;
+ private string formula;
+ private string options;
+ private string output_parameter;
+ private string default_value;
+ private bool reduce_result;
+ private bool disabled;
+
+ public IniTemplateVariable(string input, string name, string form, string opt)
+ : base(input)
+ {
+ variable_name = name;
+ formula = form;
+ options = opt;
+ reduce_result = opt.Contains("USE_BYTES");
+ disabled = false;
+ }
+
+ public string VariableName
+ {
+ get { return variable_name; }
+ }
+ public string Formula
+ {
+ get { return formula; }
+ }
+ public string Options
+ {
+ get { return options; }
+ }
+ public bool ReduceResult
+ {
+ get { return reduce_result; }
+ set { reduce_result = value; }
+ }
+ public bool Disabled
+ {
+ get { return disabled; }
+ set { disabled = value; }
+ }
+ public string OutputParameter
+ {
+ get { return output_parameter; }
+ set { output_parameter = value; }
+ }
+ public string DefaultValue
+ {
+ get { return default_value; }
+ set { default_value = value; }
+ }
+ }
+
+ public enum IniServerType
+ {
+ Developer,
+ Server,
+ Dedicated,
+ InternalUnitTest // This will produce an unusable template file that is suitable testing on disparate hardware.
+ }
+
+ public class IniTemplate
+ {
+ #region Private
+ private string template;
+ private FormulaEngine fe;
+ private Queue output;
+ private IniServerType ist;
+
+ private void SetDefaults()
+ {
+ fe = new FormulaEngine();
+ output = new Queue();
+ EnableStrictMode = true;
+ EnableNetworking = true;
+ DefaultCharacterSet = "utf8";
+ InnoDBHomeDir = "";
+ DefaultStorageEngine = "INNODB";
+ Port = "3306";
+ SkipInnodb = false;
+ Reconfiguring = false;
+ IsValid = false;
+ OutputExists = false;
+ ServerType = IniServerType.Developer;
+ FoundExistingDataDir = false;
+ }
+
+ private bool OpenTemplate(string templateName)
+ {
+ bool great_success = false;
+
+ try
+ {
+ StreamReader reader = new StreamReader(templateName);
+ string current_line = null;
+
+ while (!reader.EndOfStream)
+ {
+ current_line = reader.ReadLine();
+
+ if (current_line.StartsWith("##")) // Template comment, do not output
+ continue;
+
+ if (current_line.StartsWith("# [")) // # [VARIABLE_NAME]="Forumla", "Options"
+ {
+ Regex TemplateFormulaExp = new Regex(@"\[(?<var_name>[^@]+)\]=""(?<formula>[^""]+)""((?:,\s*"")(?<options>[^@]+)?(?:""))?");
+ Match m = TemplateFormulaExp.Match(current_line);
+
+ if (m.Success)
+ {
+ string variable_name = m.Groups["var_name"].Value;
+ IniTemplateVariable itv = new IniTemplateVariable(current_line, variable_name, m.Groups["formula"].Value, m.Groups["options"].Value);
+
+ if (variable_name != "STATE_CHANGE")
+ {
+ current_line = reader.ReadLine();
+ Regex TemplateOutputFormat = new Regex(@"(?<disabled>[#\s]+)?(?<output>.+)=(?<default>.+)?");
+ Match m2 = TemplateOutputFormat.Match(current_line);
+ if (m2.Success)
+ {
+ itv.DefaultValue = m2.Groups["default"].Value;
+ itv.Disabled = m2.Groups["disabled"].Value.Contains("#");
+ itv.OutputParameter = m2.Groups["output"].Value;
+ }
+
+ // Attempt to set values from template, just the basics.
+ switch (itv.VariableName)
+ {
+ case "BASE_DIR":
+ if (itv.DefaultValue != null)
+ {
+ string defaultValue = itv.DefaultValue.Replace('\"', ' ').Trim();
+ if (defaultValue.Length > 0)
+ BaseDir = defaultValue;
+ }
+ break;
+ case "DATA_DIR":
+ if (itv.DefaultValue != null)
+ {
+ string defaultValue = itv.DefaultValue.Replace('\"', ' ').Trim();
+ if (defaultValue.Length > 0)
+ {
+ defaultValue = defaultValue.Replace("\\data\\", "\\");
+ defaultValue = defaultValue.Replace("\\Data\\", "\\");
+ DataDir = defaultValue.Trim();
+ }
+ }
+ break;
+ case "CLIENT_PORT":
+ case "SERVER_PORT":
+ this.EnableNetworking = itv.Disabled;
+ if (EnableNetworking && itv.DefaultValue != "")
+ Port = itv.DefaultValue;
+ break;
+ case "CLIENT_PIPE":
+ case "CLIENT_SOCKET":
+ case "SERVER_PIPE":
+ case "SERVER_SOCKET":
+ case "SERVER_SKIP":
+ this.EnableNetworking = !itv.Disabled;
+ break;
+ case "INNODB_HOME":
+ if (itv.Disabled == false)
+ {
+ InnoDBHomeDir = itv.DefaultValue;
+ }
+ else
+ {
+ InnoDBHomeDir = "";
+ }
+ break;
+ case "SERVER_TYPE":
+ itv.Disabled = true;
+ switch (itv.DefaultValue)
+ {
+ case "1":
+ ServerType = IniServerType.Dedicated;
+ break;
+ case "2":
+ ServerType = IniServerType.Server;
+ break;
+ case "3":
+ default:
+ ServerType = IniServerType.Developer;
+ break;
+ }
+ break;
+ case "STATE_CHANGE":
+ case "SQL_MODE":
+ case "INNODB_LOG_FILE_SIZE":
+ case "SKIP_INNODB":
+ break;
+ }
+ }
+
+ output.Enqueue(itv);
+ }
+ }
+ else
+ {
+ output.Enqueue(new IniTemplateStatic(current_line));
+ }
+ }
+
+ reader.Close();
+ reader.Dispose();
+
+ great_success = true;
+ }
+ catch
+ {
+ // Do cleanup.
+ }
+
+ return great_success;
+ }
+
+ private string ReduceBytesToString(double value)
+ {
+ string output = "";
+ int unit_type = 0;
+ char[] unit_names = new char[4] { ' ', 'K', 'M', 'G' };
+
+ while (value / 1024 >= 1.0)
+ {
+ double round_up = 0.0;
+ if (value % 1024 > 0)
+ ++round_up;
+ value /= 1024;
+ value = Math.Round(value + round_up);
+ ++unit_type;
+ }
+
+ output += value.ToString();
+ if (unit_type >= 1)
+ output += unit_names[unit_type].ToString();
+
+ return output;
+ }
+ #endregion
+
+ #region Public
+ public IniTemplate(string base_dir, string data_dir, string template_name, string output_dir)
+ {
+ SetDefaults();
+ BaseDir = base_dir;
+ DataDir = data_dir;
+
+ ConfigurationFile = String.Format("{0}my.ini", output_dir);
+ if (File.Exists(ConfigurationFile))
+ {
+ // Create a backup of the existing file(s).
+ string datetime = DateTime.Now.GetDateTimeFormats('s')[0].Replace(':', '-');
+ string newConfig = String.Format("{0}my_{1}.ini", output_dir, datetime);
+
+ int i = 0;
+ while (File.Exists(newConfig))
+ {
+ i += 1;
+ newConfig = String.Format("{0}my_{1}_{2}.ini", output_dir, datetime, i.ToString());
+ }
+
+ File.Copy(ConfigurationFile, newConfig);
+ OutputExists = true;
+ }
+
+ IsValid = OpenTemplate(ConfigurationFile);
+ if (IsValid)
+ {
+ template = ConfigurationFile;
+ Reconfiguring = true;
+ }
+ else
+ {
+ template = template_name;
+ output.Clear();
+ IsValid = OpenTemplate(template);
+ }
+ }
+
+ public void ProcessTemplate()
+ {
+ fe.AssignFormulaVariable("basedir", String.Format("\"{0}\"", BaseDir));
+ fe.AssignFormulaVariable("datadir", String.Format("\"{0}data\\\"", DataDir));
+ fe.AssignFormulaVariable("port", Port);
+ fe.AssignFormulaVariable("default_storage_engine", DefaultStorageEngine);
+ fe.AssignFormulaVariable("default_character_set", DefaultCharacterSet);
+ fe.AssignFormulaVariable("myisam_percentage", MyisamUsage.ToString());
+ fe.AssignFormulaVariable("innodb_buffer_pool_size_percentage", InnoDBBPSUsage.ToString());
+ fe.AssignFormulaVariable("active_connections", NumberConnections.ToString());
+ fe.AssignFormulaVariable("query_cache_pct", UseQueryCache.ToString());
+
+ StreamWriter writer = new StreamWriter(ConfigurationFile);
+
+ foreach (object obj in output)
+ {
+ if (obj.GetType() == typeof(IniTemplateVariable))
+ {
+ IniTemplateVariable itv = (IniTemplateVariable)obj;
+ string result;
+ fe.Parse(itv.Formula);
+ result = fe.Evaluate();
+
+ writer.WriteLine(itv.LineAsRead);
+ switch (itv.VariableName)
+ {
+ case "STATE_CHANGE":
+ // continue;
+ break;
+ case "CLIENT_PORT":
+ case "SERVER_PORT":
+ itv.Disabled = this.EnableNetworking;
+ break;
+ case "CLIENT_PIPE":
+ case "CLIENT_SOCKET":
+ case "SERVER_PIPE":
+ case "SERVER_SOCKET":
+ case "SERVER_SKIP":
+ itv.Disabled = !this.EnableNetworking;
+ break;
+ case "SQL_MODE":
+ itv.Disabled = true;
+ break;
+ case "INNODB_HOME":
+ if (InnoDBHomeDir != "")
+ {
+ itv.Disabled = false;
+ fe.AssignFormulaVariable("innodb_home", InnoDBHomeDir);
+ }
+ else
+ {
+ itv.Disabled = true;
+ }
+ break;
+ case "INNODB_LOG_FILE_SIZE":
+ if (itv.DefaultValue != "")
+ {
+ result = itv.DefaultValue;
+ itv.ReduceResult = false;
+ }
+ break;
+ case "SKIP_INNODB":
+ itv.Disabled = SkipInnodb;
+ break;
+ }
+ if (itv.VariableName != "STATE_CHANGE")
+ writer.WriteLine((itv.Disabled ? "# " : "") + itv.OutputParameter + "=" + (itv.ReduceResult ? ReduceBytesToString(double.Parse(result)) : result));
+
+ }
+ else
+ {
+ IniTemplateStatic its = (IniTemplateStatic)obj;
+ writer.WriteLine(its.LineAsRead);
+ }
+ }
+
+ writer.Close();
+ writer.Dispose();
+ }
+
+ public IniServerType ServerType
+ {
+ get
+ {
+ return ist;
+ }
+ set
+ {
+ ist = value;
+
+ PerformanceCounter pc = new PerformanceCounter("Memory", "Available Bytes", "");
+ double system_available_memory = (double)pc.NextValue();
+ double mysql_memory_percentage = 0.08333; // By default, all servers should use 1/12 available system memory.
+
+ fe.AssignFormulaVariable("cpus", Environment.ProcessorCount.ToString());
+
+ switch (ist)
+ {
+ case IniServerType.Dedicated:
+ mysql_memory_percentage = 0.90;
+ fe.AssignFormulaVariable("server_type", "1");
+ break;
+ case IniServerType.Server:
+ mysql_memory_percentage = 0.50;
+ fe.AssignFormulaVariable("server_type", "2");
+ break;
+ case IniServerType.InternalUnitTest:
+ mysql_memory_percentage = 0;
+ system_available_memory = 0.0;
+ fe.AssignFormulaVariable("cpus", "0.0");
+ fe.AssignFormulaVariable("server_type", "4");
+ break;
+ case IniServerType.Developer:
+ default:
+ fe.AssignFormulaVariable("server_type", "3");
+ if (system_available_memory < (48 * 1024 * 1024))
+ {
+ system_available_memory = 48 * 1024 * 1024;
+ mysql_memory_percentage = 1.0;
+ }
+ break;
+ }
+
+ fe.AssignFormulaVariable("memory", (system_available_memory * mysql_memory_percentage).ToString());
+ }
+ }
+
+ public double MyisamUsage { get; set; }
+
+ public double InnoDBBPSUsage { get; set; }
+
+ public double NumberConnections { get; set; }
+
+ public double UseQueryCache { get; set; }
+
+ public bool FoundExistingDataDir { get; set; }
+
+ public bool IsValid { get; private set; }
+
+ public bool Reconfiguring { get; private set; }
+
+ public bool OutputExists { get; private set; }
+
+ public bool EnableStrictMode { get; set; }
+
+ public bool EnableNetworking { get; set; }
+
+ public bool SkipInnodb { get; set; }
+
+ public string DefaultStorageEngine { get; set; }
+
+ public string DefaultCharacterSet { get; set; }
+
+ public string BaseDir { get; set; }
+
+ public string DataDir { get; set; }
+
+ public string InnoDBHomeDir { get; set; }
+
+ public string Port { get; set; }
+
+ public string ConfigurationFile { get; set; }
+
+ #endregion
+ }
+
+ public enum FormulaTokenType
+ {
+ None,
+ Number,
+ Constant,
+ Variable,
+ Assignment,
+ Plus,
+ Minus,
+ Multiply,
+ Divide,
+ Exponent,
+ UnaryMinus,
+ Sine,
+ Cosine,
+ Tangent,
+ Round,
+ Min,
+ Max,
+ LeftParenthesis,
+ RightParenthesis
+ }
+
+ public struct FormulaToken
+ {
+ public string TokenValue;
+ public FormulaTokenType TokenValueType;
+ }
+
+ public class FormulaEngine
+ {
+ private Dictionary<string, string> formula_variables;
+ private Queue output;
+ private Stack ops;
+ private string original_expression;
+ private string transition_expression;
+ private string postfix_expression;
+
+ public string OriginalExpression
+ {
+ get { return original_expression; }
+ }
+
+ public string TransitionExpression
+ {
+ get { return transition_expression; }
+ }
+
+ public string PostfixExpression
+ {
+ get { return postfix_expression; }
+ }
+
+ public FormulaEngine()
+ {
+ original_expression = string.Empty;
+ transition_expression = string.Empty;
+ postfix_expression = string.Empty;
+ formula_variables = new Dictionary<string, string>();
+ }
+
+ public void Parse(string Expression)
+ {
+ output = new Queue();
+ ops = new Stack();
+
+ original_expression = Expression;
+
+ string rpn_buffer = Expression;
+
+ // filter out the K, M, G unit specifiers.
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<number>\d+(\.\d+)?)K", " ${number} * 1024 ");
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<number>\d+(\.\d+)?)M", " ${number} * 1024 * 1024");
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<number>\d+(\.\d+)?)G", " ${number} * 1024 * 1024 * 1024");
+ rpn_buffer = rpn_buffer.ToLower();
+
+ // captures numbers. Anything like 11 or 22.34 is captured
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<number>\d+(\.\d+)?)", " ${number} ");
+ // captures these symbols: + - * / ^ ( )
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<ops>[+\-*/^:()])", " ${ops} ");
+ // captures constants, variables, and math fucntions.
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<var>([a-z_]+))", " ${var} ");
+ // trims up consecutive spaces and replace it with just one space
+ rpn_buffer = Regex.Replace(rpn_buffer, @"\s+", " ").Trim();
+
+ // The following chunk captures unary minus operations.
+ // 1) We replace every minus sign with the string "MINUS".
+ // 2) Then if we find a "MINUS" with a number or constant in front,
+ // then it's a normal minus operation.
+ // 3) Otherwise, it's a unary minus operation.
+
+ // Step 1.
+ rpn_buffer = Regex.Replace(rpn_buffer, "-", "MINUS");
+ // Step 2. Looking for pi or e or generic number \d+(\.\d+)?
+ //rpn_buffer = Regex.Replace(rpn_buffer, @"(?<number>(pi|e|(\d+(\.\d+)?)))\s+MINUS", "${number} -");
+ rpn_buffer = Regex.Replace(rpn_buffer, @"(?<number>([a-z_]+|[)]|(\d+(\.\d+)?)))\s+MINUS", "${number} -");
+ // Step 3. Use the tilde ~ as the unary minus operator
+ rpn_buffer = Regex.Replace(rpn_buffer, "MINUS", "~");
+
+ transition_expression = rpn_buffer;
+
+ // tokenize it!
+ string[] parsed_tokens = rpn_buffer.Split(" ".ToCharArray());
+ int i = 0;
+ double token_value;
+ FormulaToken token, opstoken;
+ for (i = 0; i < parsed_tokens.Length; ++i)
+ {
+ token = new FormulaToken();
+ token.TokenValue = parsed_tokens[i];
+ token.TokenValueType = FormulaTokenType.None;
+
+ try
+ {
+ token_value = double.Parse(parsed_tokens[i]);
+ token.TokenValueType = FormulaTokenType.Number;
+ // If the token is a number, then add it to the output queue.
+ output.Enqueue(token);
+ }
+ catch
+ {
+ switch (parsed_tokens[i])
+ {
+ case "+":
+ token.TokenValueType = FormulaTokenType.Plus;
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // while there is an operator, o2, at the top of the stack
+ while (IsOperatorToken(opstoken.TokenValueType))
+ {
+ // pop o2 off the stack, onto the output queue;
+ output.Enqueue(ops.Pop());
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ // push o1 onto the operator stack.
+ ops.Push(token);
+ break;
+ case "-":
+ token.TokenValueType = FormulaTokenType.Minus;
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // while there is an operator, o2, at the top of the stack
+ while (IsOperatorToken(opstoken.TokenValueType))
+ {
+ // pop o2 off the stack, onto the output queue;
+ output.Enqueue(ops.Pop());
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ // push o1 onto the operator stack.
+ ops.Push(token);
+ break;
+ case "*":
+ token.TokenValueType = FormulaTokenType.Multiply;
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // while there is an operator, o2, at the top of the stack
+ while (IsOperatorToken(opstoken.TokenValueType))
+ {
+ if (opstoken.TokenValueType == FormulaTokenType.Plus || opstoken.TokenValueType == FormulaTokenType.Minus || opstoken.TokenValueType == FormulaTokenType.Assignment)
+ {
+ break;
+ }
+ else
+ {
+ // Once we're in here, the following algorithm condition is satisfied.
+ // o1 is associative or left-associative and its precedence is less than (lower precedence) or equal to that of o2, or
+ // o1 is right-associative and its precedence is less than (lower precedence) that of o2,
+
+ // pop o2 off the stack, onto the output queue;
+ output.Enqueue(ops.Pop());
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ }
+ // push o1 onto the operator stack.
+ ops.Push(token);
+ break;
+ case "/":
+ token.TokenValueType = FormulaTokenType.Divide;
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // while there is an operator, o2, at the top of the stack
+ while (IsOperatorToken(opstoken.TokenValueType))
+ {
+ if (opstoken.TokenValueType == FormulaTokenType.Plus || opstoken.TokenValueType == FormulaTokenType.Minus || opstoken.TokenValueType == FormulaTokenType.Assignment)
+ {
+ break;
+ }
+ else
+ {
+ // Once we're in here, the following algorithm condition is satisfied.
+ // o1 is associative or left-associative and its precedence is less than (lower precedence) or equal to that of o2, or
+ // o1 is right-associative and its precedence is less than (lower precedence) that of o2,
+
+ // pop o2 off the stack, onto the output queue;
+ output.Enqueue(ops.Pop());
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ }
+ // push o1 onto the operator stack.
+ ops.Push(token);
+ break;
+ case "^":
+ token.TokenValueType = FormulaTokenType.Exponent;
+ // push o1 onto the operator stack.
+ ops.Push(token);
+ break;
+ case "~":
+ token.TokenValueType = FormulaTokenType.UnaryMinus;
+ // push o1 onto the operator stack.
+ ops.Push(token);
+ break;
+ case "(":
+ token.TokenValueType = FormulaTokenType.LeftParenthesis;
+ // If the token is a left parenthesis, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case ")":
+ token.TokenValueType = FormulaTokenType.RightParenthesis;
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // Until the token at the top of the stack is a left parenthesis
+ while (opstoken.TokenValueType != FormulaTokenType.LeftParenthesis)
+ {
+ // pop operators off the stack onto the output queue
+ output.Enqueue(ops.Pop());
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ }
+ else
+ {
+ // If the stack runs out without finding a left parenthesis,
+ // then there are mismatched parentheses.
+ throw new Exception("Unbalanced parenthesis!");
+ }
+
+ }
+ // Pop the left parenthesis from the stack, but not onto the output queue.
+ ops.Pop();
+ }
+
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // If the token at the top of the stack is a function token
+ if (IsFunctionToken(opstoken.TokenValueType))
+ {
+ // pop it and onto the output queue.
+ output.Enqueue(ops.Pop());
+ }
+ }
+ break;
+ case "pi":
+ token.TokenValueType = FormulaTokenType.Constant;
+ // If the token is a number, then add it to the output queue.
+ output.Enqueue(token);
+ break;
+ case "e":
+ token.TokenValueType = FormulaTokenType.Constant;
+ // If the token is a number, then add it to the output queue.
+ output.Enqueue(token);
+ break;
+ case "sin":
+ token.TokenValueType = FormulaTokenType.Sine;
+ // If the token is a function token, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case "cos":
+ token.TokenValueType = FormulaTokenType.Cosine;
+ // If the token is a function token, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case "tan":
+ token.TokenValueType = FormulaTokenType.Tangent;
+ // If the token is a function token, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case "rnd":
+ token.TokenValueType = FormulaTokenType.Round;
+ // If the token is a funciton token, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case "max":
+ token.TokenValueType = FormulaTokenType.Max;
+ // If the token is a funciton token, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case "min":
+ token.TokenValueType = FormulaTokenType.Min;
+ // If the token is a funciton token, then push it onto the stack.
+ ops.Push(token);
+ break;
+ case ":":
+ // If the token is an assignment token, then push it onto the stack.
+ token.TokenValueType = FormulaTokenType.Assignment;
+ // push o0 onto the operator stack.
+ ops.Push(token);
+ break;
+ case ",":
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ // Until the token at the top of the stack is a left parenthesis
+ while (opstoken.TokenValueType != FormulaTokenType.LeftParenthesis)
+ {
+ // pop operators off the stack onto the output queue
+ output.Enqueue(ops.Pop());
+ if (ops.Count > 0)
+ {
+ opstoken = (FormulaToken)ops.Peek();
+ }
+ else
+ {
+ // If the stack runs out without finding a left parenthesis,
+ // then there are mismatched parentheses.
+ throw new Exception("Couldn't find function start!");
+ }
+ }
+ }
+ break;
+ default:
+ if (Regex.IsMatch(parsed_tokens[i], @"[a-z_]+"))
+ {
+ token.TokenValueType = FormulaTokenType.Variable;
+ output.Enqueue(token); // This is a variable.
+ }
+ break;
+ }
+ }
+ }
+
+ // While there are still operator tokens in the stack:
+ while (ops.Count != 0)
+ {
+ opstoken = (FormulaToken)ops.Pop();
+ // If the operator token on the top of the stack is a parenthesis
+ if (opstoken.TokenValueType == FormulaTokenType.LeftParenthesis)
+ {
+ // then there are mismatched parenthesis.
+ throw new Exception("Unbalanced parenthesis!");
+ }
+ else
+ {
+ // Pop the operator onto the output queue.
+ output.Enqueue(opstoken);
+ }
+ }
+
+ postfix_expression = string.Empty;
+ foreach (object obj in output)
+ {
+ opstoken = (FormulaToken)obj;
+ postfix_expression += string.Format("{0} ", opstoken.TokenValue);
+ }
+ }
+
+ public string Evaluate()
+ {
+ Stack result = new Stack();
+
+ FormulaToken token = new FormulaToken();
+ FormulaToken operand1 = new FormulaToken();
+ FormulaToken operand2 = new FormulaToken();
+ FormulaToken result_token = new FormulaToken();
+
+ // While there are input tokens left
+ foreach (object obj in output)
+ {
+ // Read the next token from input.
+ token = (FormulaToken)obj;
+ switch (token.TokenValueType)
+ {
+ case FormulaTokenType.Number:
+ case FormulaTokenType.Constant:
+ case FormulaTokenType.Variable:
+ result.Push(token);
+ break;
+ case FormulaTokenType.Assignment:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+ if ( operand1.TokenValueType == FormulaTokenType.Variable &&
+ (operand2.TokenValueType == FormulaTokenType.Number ||
+ operand2.TokenValueType == FormulaTokenType.Constant ||
+ operand2.TokenValueType == FormulaTokenType.Variable)
+ )
+ formula_variables[operand1.TokenValue] = GetTokenValue(operand2).ToString();
+ else
+ throw new Exception("Assignment error!");
+
+ result.Push(operand1);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Plus:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = (GetTokenValue(operand2) + GetTokenValue(operand1)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Minus:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = (GetTokenValue(operand1) - GetTokenValue(operand2)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Multiply:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = (GetTokenValue(operand2) * GetTokenValue(operand1)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Divide:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = (GetTokenValue(operand1) / GetTokenValue(operand2)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Exponent:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = Math.Pow(GetTokenValue(operand1), GetTokenValue(operand2)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.UnaryMinus:
+ if (result.Count >= 1)
+ {
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = (-GetTokenValue(operand1)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Sine:
+ if (result.Count >= 1)
+ {
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = Math.Sin(GetTokenValue(operand1)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Cosine:
+ if (result.Count >= 1)
+ {
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = Math.Cos(GetTokenValue(operand1)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Tangent:
+ if (result.Count >= 1)
+ {
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = Math.Tan(GetTokenValue(operand1)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Round:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ result_token.TokenValueType = FormulaTokenType.Number;
+ result_token.TokenValue = Math.Round((GetTokenValue(operand1) / GetTokenValue(operand2)) * GetTokenValue(operand2)).ToString();
+
+ result.Push(result_token);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Max:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ if (GetTokenValue(operand1) >= GetTokenValue(operand2))
+ result.Push(operand1);
+ else
+ result.Push(operand2);
+
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ case FormulaTokenType.Min:
+ if (result.Count >= 2)
+ {
+ operand2 = (FormulaToken)result.Pop();
+ operand1 = (FormulaToken)result.Pop();
+
+ if (GetTokenValue(operand1) <= GetTokenValue(operand2))
+ result.Push(operand1);
+ else
+ result.Push(operand2);
+ }
+ else
+ throw new Exception("Evaluation error!");
+ break;
+ }
+ }
+
+ // If there is only one value in the stack
+ if (result.Count == 1)
+ {
+ // That value is the result of the calculation.
+ return GetTokenText((FormulaToken)result.Pop());
+ }
+ else
+ {
+ // If there are more values in the stack
+ // (Error) The user input too many values.
+ throw new Exception("Evaluation error!");
+ }
+ }
+
+ public void AssignFormulaVariable(string key_name, string value)
+ {
+ string variable_value;
+ formula_variables.TryGetValue(key_name, out variable_value);
+ if(variable_value != value)
+ formula_variables[key_name] = value;
+ return;
+ }
+
+ private string GetTokenText(FormulaToken token)
+ {
+ string token_value = String.Empty;
+
+ switch (token.TokenValueType)
+ {
+ case FormulaTokenType.Number:
+ token_value = token.TokenValue;
+ break;
+ case FormulaTokenType.Variable:
+ if (!formula_variables.TryGetValue(token.TokenValue, out token_value))
+ token_value = "0.0";
+ break;
+ case FormulaTokenType.Constant:
+ switch (token.TokenValue)
+ {
+ case "pi":
+ token_value = Math.PI.ToString();
+ break;
+ case "e":
+ token_value = Math.E.ToString();
+ break;
+ }
+ break;
+ }
+
+ return token_value;
+ }
+
+ private double GetTokenValue(FormulaToken token)
+ {
+ return double.Parse(GetTokenText(token));
+ }
+
+ private bool IsOperatorToken(FormulaTokenType t)
+ {
+ bool result = false;
+ switch (t)
+ {
+ case FormulaTokenType.Plus:
+ case FormulaTokenType.Minus:
+ case FormulaTokenType.Multiply:
+ case FormulaTokenType.Divide:
+ case FormulaTokenType.Exponent:
+ case FormulaTokenType.UnaryMinus:
+ result = true;
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ }
+
+ private bool IsFunctionToken(FormulaTokenType t)
+ {
+ bool result = false;
+ switch (t)
+ {
+ case FormulaTokenType.Sine:
+ case FormulaTokenType.Cosine:
+ case FormulaTokenType.Tangent:
+ case FormulaTokenType.Round:
+ case FormulaTokenType.Max:
+ case FormulaTokenType.Min:
+ result = true;
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ }
+
+ }
+}
=== added file 'StandardPlugins/MysqlSCM.cs'
--- a/StandardPlugins/MysqlSCM.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/MysqlSCM.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,455 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.IO;
+using System.Resources;
+using System.Runtime.InteropServices;
+using System.Runtime.ConstrainedExecution;
+using System.Security;
+using System.Security.Permissions;
+using System.ServiceProcess;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using Microsoft.Win32;
+
+namespace WexInstaller.Core
+{
+ public class MySQLServiceControlManager
+ {
+ #region Private
+ private TimeSpan ts;
+ #endregion
+
+ #region Public
+ public MySQLServiceControlManager()
+ {
+ ts = new TimeSpan(0, 0, 20); // 20 Second timeout.
+ }
+
+ public string FindServiceName(string baseDirectory)
+ {
+ string foundService = String.Empty;
+
+ // Search through all the registry keys for each reference to each instance's bin location.
+ try
+ {
+ ServiceController[] scmServices;
+ scmServices = ServiceController.GetServices();
+
+ foreach (ServiceController scmService in scmServices)
+ {
+ ExpandedServiceController superSerivceController = new ExpandedServiceController(scmService);
+
+ string regexSeed = Path.GetFullPath(baseDirectory) + ".";
+ regexSeed = regexSeed.Replace(@"\", @"\\");
+ regexSeed = regexSeed.Replace(@"(", @"\(");
+ regexSeed = regexSeed.Replace(@")", @"\)");
+
+ Regex localTemplate = new Regex(regexSeed.ToString());
+ Match localMatch = localTemplate.Match(superSerivceController.BinaryPath);
+
+ if (localMatch.Success)
+ {
+ foundService = superSerivceController.ServiceName;
+ }
+
+ superSerivceController.Close();
+ scmService.Close();
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+
+ return foundService;
+ }
+
+ public void Add(string serviceName, string displayName, string fileName)
+ {
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName, displayName, fileName);
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ public void Delete(string serviceName)
+ {
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ ssc.Remove(); // Automatically calls .Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ public void Start(string serviceName)
+ {
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ ssc.Start();
+ ssc.WaitForStatus(ServiceControllerStatus.Running, ts);
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ public void Stop(string serviceName)
+ {
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ ssc.Stop();
+ ssc.WaitForStatus(ServiceControllerStatus.Stopped, ts);
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ public void Restart(string serviceName)
+ {
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ if (ssc.Status == ServiceControllerStatus.Running)
+ ssc.Stop();
+ ssc.WaitForStatus(ServiceControllerStatus.Stopped, ts);
+ ssc.Start();
+ ssc.WaitForStatus(ServiceControllerStatus.Running, ts);
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ public void Update(string serviceName, string fileName)
+ {
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ if (ssc.Status == ServiceControllerStatus.Running)
+ ssc.Stop();
+ ssc.WaitForStatus(ServiceControllerStatus.Stopped, ts);
+ ssc.BinaryPath = fileName;
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ }
+
+ public string BinaryPath(string serviceName)
+ {
+ String binaryPath = String.Empty;
+
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ binaryPath = ssc.BinaryPath;
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+
+ return binaryPath;
+ }
+
+ public ServiceControllerStatus GetServiceStatus(string serviceName)
+ {
+ ServiceControllerStatus currentStatus = ServiceControllerStatus.Stopped;
+ try
+ {
+ ExpandedServiceController ssc = new ExpandedServiceController(serviceName);
+ currentStatus = ssc.Status;
+ ssc.Close();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ return currentStatus;
+ }
+
+ #endregion
+ }
+
+ internal static class SystemServiceProcessNativeMethods
+ {
+ #region Fields
+ public const int ACCESS_TYPE_ALL = 0xf01ff;
+ public const int ACCESS_TYPE_CHANGE_CONFIG = 2;
+ public const int ACCESS_TYPE_ENUMERATE_DEPENDENTS = 8;
+ public const int ACCESS_TYPE_INTERROGATE = 0x80;
+ public const int ACCESS_TYPE_PAUSE_CONTINUE = 0x40;
+ public const int ACCESS_TYPE_QUERY_CONFIG = 1;
+ public const int ACCESS_TYPE_QUERY_STATUS = 4;
+ public const int ACCESS_TYPE_START = 0x10;
+ public const int ACCESS_TYPE_STOP = 0x20;
+ public const int ACCESS_TYPE_DELETE = 0x00010000;
+ public const int ACCESS_TYPE_USER_DEFINED_CONTROL = 0x100;
+ public const int ERROR_CONTROL_CRITICAL = 3;
+ public const int ERROR_CONTROL_IGNORE = 0;
+ public const int ERROR_CONTROL_NORMAL = 1;
+ public const int ERROR_CONTROL_SEVERE = 2;
+ public const int SC_MANAGER_ALL = 0xf003f;
+ public const int SC_MANAGER_CONNECT = 1;
+ public const int SC_MANAGER_CREATE_SERVICE = 2;
+ public const int SC_MANAGER_ENUMERATE_SERVICE = 4;
+ public const int SC_MANAGER_LOCK = 8;
+ public const int SC_MANAGER_MODIFY_BOOT_CONFIG = 0x20;
+ public const int SC_MANAGER_QUERY_LOCK_STATUS = 0x10;
+ public const int START_TYPE_AUTO = 2;
+ public const int START_TYPE_BOOT = 0;
+ public const int START_TYPE_DEMAND = 3;
+ public const int START_TYPE_DISABLED = 4;
+ public const int START_TYPE_SYSTEM = 1;
+ public const int SERVICE_TYPE_ADAPTER = 4;
+ public const int SERVICE_TYPE_ALL = 0x13f;
+ public const int SERVICE_TYPE_DRIVER = 11;
+ public const int SERVICE_TYPE_FILE_SYSTEM_DRIVER = 2;
+ public const int SERVICE_TYPE_INTERACTIVE_PROCESS = 0x100;
+ public const int SERVICE_TYPE_KERNEL_DRIVER = 1;
+ public const int SERVICE_TYPE_RECOGNIZER_DRIVER = 8;
+ public const int SERVICE_TYPE_WIN32 = 0x30;
+ public const int SERVICE_TYPE_WIN32_OWN_PROCESS = 0x10;
+ public const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
+ #endregion
+
+ #region Methods
+ [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ public static extern bool CloseServiceHandle(IntPtr handle);
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ public static extern IntPtr OpenSCManager(string machineName, string databaseName, int access);
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ public static extern IntPtr CreateService(IntPtr databaseHandle, string serviceName, string displayName, int access, int serviceType, int startType, int errorControl, string binaryPath, string loadOrderGroup, IntPtr pTagId, string dependencies, string servicesStartName, string password);
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ public static extern bool DeleteService(IntPtr serviceHandle);
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ public static extern IntPtr OpenService(IntPtr databaseHandle, string serviceName, int access);
+ #endregion
+
+ #region Nested Types
+ /*
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct SC_ACTION
+ {
+ public int type;
+ public uint delay;
+ }
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct SERVICE_DESCRIPTION
+ {
+ public IntPtr description;
+ }
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct SERVICE_FAILURE_ACTIONS
+ {
+ public uint dwResetPeriod;
+ public IntPtr rebootMsg;
+ public IntPtr command;
+ public uint numActions;
+ public unsafe SystemServiceProcessNativeMethods.SC_ACTION* actions;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SERVICE_STATUS
+ {
+ public int serviceType;
+ public int currentState;
+ public int controlsAccepted;
+ public int win32ExitCode;
+ public int serviceSpecificExitCode;
+ public int checkPoint;
+ public int waitHint;
+ }
+ */
+ #endregion
+ }
+
+ // Wrapper for the ServiceController object that adds ability to Add and remove services and use service BinaryPath
+ public class ExpandedServiceController : ServiceController
+ {
+ #region Private
+ // Parameters
+ private string binaryPath;
+
+ // Methods
+ private static Win32Exception CreateSafeWin32Exception()
+ {
+ Win32Exception exception = null;
+ new SecurityPermission(PermissionState.Unrestricted).Assert();
+ try
+ {
+ exception = new Win32Exception();
+ }
+ finally
+ {
+ CodeAccessPermission.RevertAssert();
+ }
+ return exception;
+ }
+
+ private static IntPtr GetDataBaseHandleWithAllAccess(string machineName)
+ {
+ IntPtr zero = IntPtr.Zero;
+ if (machineName.Equals(".") || (machineName.Length == 0))
+ {
+ zero = SystemServiceProcessNativeMethods.OpenSCManager(null, null, (SystemServiceProcessNativeMethods.SC_MANAGER_ALL | SystemServiceProcessNativeMethods.ACCESS_TYPE_DELETE));
+ }
+ else
+ {
+ zero = SystemServiceProcessNativeMethods.OpenSCManager(machineName, null, (SystemServiceProcessNativeMethods.SC_MANAGER_ALL | SystemServiceProcessNativeMethods.ACCESS_TYPE_DELETE));
+ }
+ if (zero == IntPtr.Zero)
+ {
+ Exception innerException = CreateSafeWin32Exception();
+ throw new InvalidOperationException("Failed to open connection to service database.", innerException);
+ }
+ return zero;
+ }
+
+ private void GetBinaryPath()
+ {
+ RegistryKey serviceEntry = Registry.LocalMachine;
+ try
+ {
+ serviceEntry = serviceEntry.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\" + this.ServiceName, false);
+ binaryPath = serviceEntry.GetValue("ImagePath", "").ToString();
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ binaryPath = String.Empty;
+ }
+ finally
+ {
+ serviceEntry.Close();
+ }
+ }
+ #endregion
+
+ #region Public
+ // Wrapper for existing constructors
+ public ExpandedServiceController(string name)
+ : base(name)
+ {
+ GetBinaryPath();
+ }
+
+ // New constructors used to create new services and cope an existing one.
+ public ExpandedServiceController(string name, string displayName, string fileName)
+ : base()
+ {
+ // Create the new Service.
+ IntPtr scm = GetDataBaseHandleWithAllAccess(base.MachineName);
+
+ try
+ {
+ IntPtr service = SystemServiceProcessNativeMethods.OpenService(scm, name, SystemServiceProcessNativeMethods.ACCESS_TYPE_ALL);
+
+ if (service == IntPtr.Zero)
+ service = SystemServiceProcessNativeMethods.CreateService(scm, name, displayName, SystemServiceProcessNativeMethods.ACCESS_TYPE_ALL, SystemServiceProcessNativeMethods.SERVICE_TYPE_WIN32_OWN_PROCESS, SystemServiceProcessNativeMethods.START_TYPE_AUTO, SystemServiceProcessNativeMethods.ERROR_CONTROL_NORMAL, fileName, null, IntPtr.Zero, null, null, null);
+
+ if (service == IntPtr.Zero)
+ throw CreateSafeWin32Exception();
+ }
+ finally
+ {
+ SystemServiceProcessNativeMethods.CloseServiceHandle(scm);
+ }
+
+ this.ServiceName = name;
+ this.DisplayName = displayName;
+
+ GetBinaryPath();
+ }
+ public ExpandedServiceController(ServiceController defaultBase)
+ : base(defaultBase.ServiceName, defaultBase.MachineName)
+ {
+ GetBinaryPath();
+ }
+
+ public void Remove()
+ {
+ string serviceName = this.ServiceName;
+ string machineName = this.MachineName;
+
+ if (this.Status == ServiceControllerStatus.Running)
+ this.Stop();
+ this.WaitForStatus(ServiceControllerStatus.Stopped);
+ base.Close();
+
+ IntPtr scm = GetDataBaseHandleWithAllAccess(machineName);
+
+ try
+ {
+ IntPtr service = SystemServiceProcessNativeMethods.OpenService(scm, serviceName, SystemServiceProcessNativeMethods.ACCESS_TYPE_ALL | SystemServiceProcessNativeMethods.ACCESS_TYPE_DELETE);
+ if (service == IntPtr.Zero)
+ throw CreateSafeWin32Exception();
+
+ try
+ {
+ if (!SystemServiceProcessNativeMethods.DeleteService(service))
+ throw CreateSafeWin32Exception();
+ }
+ finally
+ {
+ SystemServiceProcessNativeMethods.CloseServiceHandle(service);
+ }
+ }
+ finally
+ {
+ SystemServiceProcessNativeMethods.CloseServiceHandle(scm);
+ }
+
+ }
+
+ public string BinaryPath
+ {
+ get { return binaryPath; }
+ set
+ {
+ binaryPath = value;
+ RegistryKey serviceEntry = Registry.LocalMachine;
+ try
+ {
+ serviceEntry = serviceEntry.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\" + this.ServiceName, true);
+ serviceEntry.SetValue("ImagePath", binaryPath);
+ }
+ catch (Exception e)
+ {
+ Logger.LogException(e);
+ }
+ finally
+ {
+ serviceEntry.Close();
+ }
+ }
+ }
+ #endregion
+ }
+}
=== added directory 'StandardPlugins/Properties'
=== added file 'StandardPlugins/Properties/AssemblyInfo.cs'
--- a/StandardPlugins/Properties/AssemblyInfo.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/Properties/AssemblyInfo.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("StandardProducts")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("StandardProducts")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d2f0e52a-461c-4afa-a849-2a17d66bf612")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
=== added file 'StandardPlugins/Properties/Resources.Designer.cs'
--- a/StandardPlugins/Properties/Resources.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/Properties/Resources.Designer.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,179 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace WexInstaller.Plugins.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WexInstaller.Plugins.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ internal static System.Drawing.Bitmap ActionCurrent {
+ get {
+ object obj = ResourceManager.GetObject("ActionCurrent", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap ActionDone {
+ get {
+ object obj = ResourceManager.GetObject("ActionDone", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap ActionError {
+ get {
+ object obj = ResourceManager.GetObject("ActionError", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap ActionOpen {
+ get {
+ object obj = ResourceManager.GetObject("ActionOpen", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap ActionWarning {
+ get {
+ object obj = ResourceManager.GetObject("ActionWarning", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap dedicated_machine {
+ get {
+ object obj = ResourceManager.GetObject("dedicated_machine", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap dev_machine {
+ get {
+ object obj = ResourceManager.GetObject("dev_machine", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap fading_divider {
+ get {
+ object obj = ResourceManager.GetObject("fading_divider", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to &Next >.
+ /// </summary>
+ internal static string NextButtonDefaultText {
+ get {
+ return ResourceManager.GetString("NextButtonDefaultText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to &Execute.
+ /// </summary>
+ internal static string NextButtonExecuteText {
+ get {
+ return ResourceManager.GetString("NextButtonExecuteText", resourceCulture);
+ }
+ }
+
+ internal static System.Drawing.Bitmap server_config_networking {
+ get {
+ object obj = ResourceManager.GetObject("server_config_networking", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap server_config_security {
+ get {
+ object obj = ResourceManager.GetObject("server_config_security", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap server_config_windows {
+ get {
+ object obj = ResourceManager.GetObject("server_config_windows", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap server_confirm {
+ get {
+ object obj = ResourceManager.GetObject("server_confirm", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap server_machine {
+ get {
+ object obj = ResourceManager.GetObject("server_machine", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap warning_sign {
+ get {
+ object obj = ResourceManager.GetObject("warning_sign", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
=== added file 'StandardPlugins/Properties/Resources.resx'
--- a/StandardPlugins/Properties/Resources.resx 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/Properties/Resources.resx 2011-02-07 21:39:05 +0000
@@ -0,0 +1,170 @@
+<?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>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="ActionCurrent" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ActionCurrent.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="ActionDone" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ActionDone.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="ActionError" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ActionError.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="ActionOpen" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ActionOpen.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="ActionWarning" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ActionWarning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="dedicated_machine" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\dedicated_machine.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="dev_machine" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\dev_machine.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="fading_divider" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\fading_divider.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="NextButtonDefaultText" xml:space="preserve">
+ <value>&Next ></value>
+ </data>
+ <data name="NextButtonExecuteText" xml:space="preserve">
+ <value>&Execute</value>
+ </data>
+ <data name="server_config_networking" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\server_config_networking.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="server_config_security" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\server_config_security.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="server_config_windows" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\server_config_windows.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="server_confirm" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\server-confirm.JPG;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="server_machine" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\server_machine.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="warning_sign" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\warning_sign.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+</root>
\ No newline at end of file
=== added directory 'StandardPlugins/Resources'
=== added file 'StandardPlugins/Resources/ActionCurrent.png'
Binary files a/StandardPlugins/Resources/ActionCurrent.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/ActionCurrent.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/ActionDone.png'
Binary files a/StandardPlugins/Resources/ActionDone.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/ActionDone.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/ActionError.png'
Binary files a/StandardPlugins/Resources/ActionError.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/ActionError.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/ActionOpen.png'
Binary files a/StandardPlugins/Resources/ActionOpen.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/ActionOpen.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/ActionWarning.png'
Binary files a/StandardPlugins/Resources/ActionWarning.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/ActionWarning.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/dedicated_machine.png'
Binary files a/StandardPlugins/Resources/dedicated_machine.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/dedicated_machine.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/dev_machine.png'
Binary files a/StandardPlugins/Resources/dev_machine.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/dev_machine.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/fading_divider.png'
Binary files a/StandardPlugins/Resources/fading_divider.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/fading_divider.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/server-confirm.JPG'
Binary files a/StandardPlugins/Resources/server-confirm.JPG 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/server-confirm.JPG 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/server_config_networking.png'
Binary files a/StandardPlugins/Resources/server_config_networking.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/server_config_networking.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/server_config_security.png'
Binary files a/StandardPlugins/Resources/server_config_security.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/server_config_security.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/server_config_windows.png'
Binary files a/StandardPlugins/Resources/server_config_windows.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/server_config_windows.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/server_machine.png'
Binary files a/StandardPlugins/Resources/server_machine.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/server_machine.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/Resources/warning_sign.png'
Binary files a/StandardPlugins/Resources/warning_sign.png 1970-01-01 00:00:00 +0000 and b/StandardPlugins/Resources/warning_sign.png 2011-02-07 21:39:05 +0000 differ
=== added file 'StandardPlugins/ServerConfigPanel1.Designer.cs'
--- a/StandardPlugins/ServerConfigPanel1.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel1.Designer.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,207 @@
+using WexInstaller.Plugins.Properties;
+namespace WexInstaller.Plugins
+{
+ partial class ServerConfigStep1
+ {
+ /// <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.actionLabel = new System.Windows.Forms.Label();
+ this.devMachine = new System.Windows.Forms.RadioButton();
+ this.serverMachine = new System.Windows.Forms.RadioButton();
+ this.dedicatedMachine = new System.Windows.Forms.RadioButton();
+ this.pictureBox2 = new System.Windows.Forms.PictureBox();
+ this.pictureBox3 = new System.Windows.Forms.PictureBox();
+ this.pictureBox4 = new System.Windows.Forms.PictureBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
+ this.SuspendLayout();
+ //
+ // actionLabel
+ //
+ this.actionLabel.Font = new System.Drawing.Font("Tahoma", 10F);
+ this.actionLabel.Location = new System.Drawing.Point(12, 80);
+ this.actionLabel.Name = "actionLabel";
+ this.actionLabel.Size = new System.Drawing.Size(443, 23);
+ this.actionLabel.TabIndex = 2;
+ this.actionLabel.Text = "Please select the type of configuration for the MySQL Server instance.";
+ //
+ // devMachine
+ //
+ this.devMachine.AutoSize = true;
+ this.devMachine.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.devMachine.Location = new System.Drawing.Point(15, 114);
+ this.devMachine.Name = "devMachine";
+ this.devMachine.Size = new System.Drawing.Size(133, 17);
+ this.devMachine.TabIndex = 3;
+ this.devMachine.TabStop = true;
+ this.devMachine.Text = "&Developer Machine";
+ this.devMachine.UseVisualStyleBackColor = true;
+ this.devMachine.CheckedChanged += new System.EventHandler(this.machineType_CheckedChanged);
+ //
+ // serverMachine
+ //
+ this.serverMachine.AutoSize = true;
+ this.serverMachine.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.serverMachine.Location = new System.Drawing.Point(15, 197);
+ this.serverMachine.Name = "serverMachine";
+ this.serverMachine.Size = new System.Drawing.Size(113, 17);
+ this.serverMachine.TabIndex = 4;
+ this.serverMachine.TabStop = true;
+ this.serverMachine.Text = "&Server Machine";
+ this.serverMachine.UseVisualStyleBackColor = true;
+ this.serverMachine.CheckedChanged += new System.EventHandler(this.machineType_CheckedChanged);
+ //
+ // dedicatedMachine
+ //
+ this.dedicatedMachine.AutoSize = true;
+ this.dedicatedMachine.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.dedicatedMachine.Location = new System.Drawing.Point(15, 287);
+ this.dedicatedMachine.Name = "dedicatedMachine";
+ this.dedicatedMachine.Size = new System.Drawing.Size(132, 17);
+ this.dedicatedMachine.TabIndex = 5;
+ this.dedicatedMachine.TabStop = true;
+ this.dedicatedMachine.Text = "D&edicated Machine";
+ this.dedicatedMachine.UseVisualStyleBackColor = true;
+ this.dedicatedMachine.CheckedChanged += new System.EventHandler(this.machineType_CheckedChanged);
+ //
+ // pictureBox2
+ //
+ this.pictureBox2.Image = Resources.dev_machine;
+ this.pictureBox2.Location = new System.Drawing.Point(46, 140);
+ this.pictureBox2.Name = "pictureBox2";
+ this.pictureBox2.Size = new System.Drawing.Size(46, 44);
+ this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox2.TabIndex = 6;
+ this.pictureBox2.TabStop = false;
+ //
+ // pictureBox3
+ //
+ this.pictureBox3.Image = Resources.server_machine;
+ this.pictureBox3.Location = new System.Drawing.Point(46, 223);
+ this.pictureBox3.Name = "pictureBox3";
+ this.pictureBox3.Size = new System.Drawing.Size(41, 44);
+ this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox3.TabIndex = 7;
+ this.pictureBox3.TabStop = false;
+ //
+ // pictureBox4
+ //
+ this.pictureBox4.Image = Resources.dedicated_machine;
+ this.pictureBox4.Location = new System.Drawing.Point(46, 313);
+ this.pictureBox4.Name = "pictureBox4";
+ this.pictureBox4.Size = new System.Drawing.Size(56, 48);
+ this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox4.TabIndex = 8;
+ this.pictureBox4.TabStop = false;
+ //
+ // label2
+ //
+ this.label2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label2.ForeColor = System.Drawing.Color.Gray;
+ this.label2.Location = new System.Drawing.Point(126, 140);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(282, 44);
+ this.label2.TabIndex = 9;
+ this.label2.Text = "This is a development machine, and many other applications will be installed on i" +
+ "t. A minimal amount of memory will be used by MySQL.";
+ //
+ // label3
+ //
+ this.label3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label3.ForeColor = System.Drawing.Color.Gray;
+ this.label3.Location = new System.Drawing.Point(126, 223);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(282, 44);
+ this.label3.TabIndex = 10;
+ this.label3.Text = "Several server applications will be running on this machine. Choose this option " +
+ "for web/application servers. MySQL will have medium memory usage.";
+ //
+ // label4
+ //
+ this.label4.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label4.ForeColor = System.Drawing.Color.Gray;
+ this.label4.Location = new System.Drawing.Point(126, 313);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(282, 44);
+ this.label4.TabIndex = 11;
+ this.label4.Text = "This machine is dedicated to running the MySQL database server. No other servers" +
+ ", such as web servers, will be run. MySQL will make use of all available memory" +
+ ".";
+ //
+ // ServerConfigStep1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.pictureBox4);
+ this.Controls.Add(this.pictureBox3);
+ this.Controls.Add(this.pictureBox2);
+ this.Controls.Add(this.dedicatedMachine);
+ this.Controls.Add(this.serverMachine);
+ this.Controls.Add(this.devMachine);
+ this.Controls.Add(this.actionLabel);
+ this.DoubleBuffered = true;
+ this.Name = "ServerConfigStep1";
+ this.Size = new System.Drawing.Size(560, 499);
+ this.Controls.SetChildIndex(this.actionLabel, 0);
+ this.Controls.SetChildIndex(this.devMachine, 0);
+ this.Controls.SetChildIndex(this.serverMachine, 0);
+ this.Controls.SetChildIndex(this.dedicatedMachine, 0);
+ this.Controls.SetChildIndex(this.pictureBox2, 0);
+ this.Controls.SetChildIndex(this.pictureBox3, 0);
+ this.Controls.SetChildIndex(this.pictureBox4, 0);
+ this.Controls.SetChildIndex(this.label2, 0);
+ this.Controls.SetChildIndex(this.label3, 0);
+ this.Controls.SetChildIndex(this.label4, 0);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label actionLabel;
+ private System.Windows.Forms.RadioButton devMachine;
+ private System.Windows.Forms.RadioButton serverMachine;
+ private System.Windows.Forms.RadioButton dedicatedMachine;
+ private System.Windows.Forms.PictureBox pictureBox2;
+ private System.Windows.Forms.PictureBox pictureBox3;
+ private System.Windows.Forms.PictureBox pictureBox4;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label4;
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel1.cs'
--- a/StandardPlugins/ServerConfigPanel1.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel1.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace WexInstaller.Plugins
+{
+ public partial class ServerConfigStep1 : InstallerPanel
+ {
+ public ServerConfigStep1(ServerConfigurationController controller)
+ {
+ InitializeComponent();
+ Caption = "MySQL Server Configuration";
+ Controller = controller;
+ }
+
+ public override void Activate()
+ {
+ if (Controller.it != null && Controller.it.Reconfiguring)
+ {
+ switch (Controller.it.ServerType)
+ {
+ case Core.IniServerType.Dedicated:
+ dedicatedMachine.Checked = true;
+ break;
+ case Core.IniServerType.Developer:
+ devMachine.Checked = true;
+ break;
+ case Core.IniServerType.Server:
+ serverMachine.Checked = true;
+ break;
+ }
+ }
+
+ base.Activate();
+ }
+
+ private ServerConfigurationController Controller { get; set; }
+
+ private void machineType_CheckedChanged(object sender, EventArgs e)
+ {
+ if (devMachine.Checked)
+ Controller.ServerInstallType = ServerInstallType.Developer;
+ else if (serverMachine.Checked)
+ Controller.ServerInstallType = ServerInstallType.Server;
+ else if (dedicatedMachine.Checked)
+ Controller.ServerInstallType = ServerInstallType.Dedicated;
+ }
+
+ public override bool Next()
+ {
+ NextButton.Enabled = false;
+ return base.Next();
+ }
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel1.resx'
--- a/StandardPlugins/ServerConfigPanel1.resx 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel1.resx 2011-02-07 21:39:05 +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
=== added file 'StandardPlugins/ServerConfigPanel2.Designer.cs'
--- a/StandardPlugins/ServerConfigPanel2.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel2.Designer.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,448 @@
+using WexInstaller.Plugins.Properties;
+
+namespace WexInstaller.Plugins
+{
+ partial class ServerConfigStep2
+ {
+ /// <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.actionLabel = new System.Windows.Forms.Label();
+ this.pictureBox2 = new System.Windows.Forms.PictureBox();
+ this.pictureBox3 = new System.Windows.Forms.PictureBox();
+ this.pictureBox4 = new System.Windows.Forms.PictureBox();
+ this.enableTCPIP = new System.Windows.Forms.CheckBox();
+ this.networkingDescriptionLabel = new System.Windows.Forms.Label();
+ this.serviceDescriptionLabel = new System.Windows.Forms.Label();
+ this.securityDescriptionLabel = new System.Windows.Forms.Label();
+ this.pictureBox5 = new System.Windows.Forms.PictureBox();
+ this.portNumber = new System.Windows.Forms.TextBox();
+ this.portLabel = new System.Windows.Forms.Label();
+ this.serviceLabel = new System.Windows.Forms.Label();
+ this.serviceName = new System.Windows.Forms.TextBox();
+ this.pictureBox6 = new System.Windows.Forms.PictureBox();
+ this.securitySettingsLabel = new System.Windows.Forms.Label();
+ this.passwordLabel = new System.Windows.Forms.Label();
+ this.rootPassword = new System.Windows.Forms.TextBox();
+ this.repeatPasswordLabel = new System.Windows.Forms.Label();
+ this.rootPasswordRepeat = new System.Windows.Forms.TextBox();
+ this.portErrorSign = new System.Windows.Forms.PictureBox();
+ this.rootPwdErrorSign = new System.Windows.Forms.PictureBox();
+ this.rootPasswordError = new System.Windows.Forms.Label();
+ this.serviceErrorSign = new System.Windows.Forms.PictureBox();
+ this.existingPasswordLabel = new System.Windows.Forms.Label();
+ this.existingRootPassword = new System.Windows.Forms.TextBox();
+ this.createService = new System.Windows.Forms.CheckBox();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.portErrorSign)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.rootPwdErrorSign)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.serviceErrorSign)).BeginInit();
+ this.SuspendLayout();
+ //
+ // actionLabel
+ //
+ this.actionLabel.AutoSize = true;
+ this.actionLabel.Font = new System.Drawing.Font("Tahoma", 10F);
+ this.actionLabel.Location = new System.Drawing.Point(12, 80);
+ this.actionLabel.Name = "actionLabel";
+ this.actionLabel.Size = new System.Drawing.Size(370, 17);
+ this.actionLabel.TabIndex = 2;
+ this.actionLabel.Text = "Please specify the Network, Windows, and Security settings";
+ //
+ // pictureBox2
+ //
+ this.pictureBox2.Image = Resources.server_config_networking;
+ this.pictureBox2.Location = new System.Drawing.Point(35, 132);
+ this.pictureBox2.Name = "pictureBox2";
+ this.pictureBox2.Size = new System.Drawing.Size(55, 56);
+ this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox2.TabIndex = 3;
+ this.pictureBox2.TabStop = false;
+ //
+ // pictureBox3
+ //
+ this.pictureBox3.Image = Resources.server_config_security;
+ this.pictureBox3.Location = new System.Drawing.Point(35, 358);
+ this.pictureBox3.Name = "pictureBox3";
+ this.pictureBox3.Size = new System.Drawing.Size(60, 51);
+ this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox3.TabIndex = 4;
+ this.pictureBox3.TabStop = false;
+ //
+ // pictureBox4
+ //
+ this.pictureBox4.Image = Resources.server_config_windows;
+ this.pictureBox4.Location = new System.Drawing.Point(35, 242);
+ this.pictureBox4.Name = "pictureBox4";
+ this.pictureBox4.Size = new System.Drawing.Size(58, 55);
+ this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox4.TabIndex = 5;
+ this.pictureBox4.TabStop = false;
+ //
+ // enableTCPIP
+ //
+ this.enableTCPIP.AutoSize = true;
+ this.enableTCPIP.Checked = true;
+ this.enableTCPIP.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.enableTCPIP.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.enableTCPIP.Location = new System.Drawing.Point(15, 110);
+ this.enableTCPIP.Name = "enableTCPIP";
+ this.enableTCPIP.Size = new System.Drawing.Size(172, 17);
+ this.enableTCPIP.TabIndex = 6;
+ this.enableTCPIP.Text = "&Enable TCP/IP Networking";
+ this.enableTCPIP.UseVisualStyleBackColor = true;
+ this.enableTCPIP.CheckedChanged += new System.EventHandler(this.enableTCPIP_CheckedChanged);
+ //
+ // networkingDescriptionLabel
+ //
+ this.networkingDescriptionLabel.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.networkingDescriptionLabel.ForeColor = System.Drawing.Color.Gray;
+ this.networkingDescriptionLabel.Location = new System.Drawing.Point(107, 132);
+ this.networkingDescriptionLabel.Name = "networkingDescriptionLabel";
+ this.networkingDescriptionLabel.Size = new System.Drawing.Size(338, 36);
+ this.networkingDescriptionLabel.TabIndex = 7;
+ this.networkingDescriptionLabel.Text = "Enable this to allow TCP/IP networking. Only localhost connections through named" +
+ " pipes are allowed when this option is skipped.";
+ //
+ // serviceDescriptionLabel
+ //
+ this.serviceDescriptionLabel.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.serviceDescriptionLabel.ForeColor = System.Drawing.Color.Gray;
+ this.serviceDescriptionLabel.Location = new System.Drawing.Point(107, 242);
+ this.serviceDescriptionLabel.Name = "serviceDescriptionLabel";
+ this.serviceDescriptionLabel.Size = new System.Drawing.Size(338, 36);
+ this.serviceDescriptionLabel.TabIndex = 8;
+ this.serviceDescriptionLabel.Text = "Please specify a Windows Service name to be used for this MySQL Server instance. " +
+ " A unique name is required for each instance.";
+ //
+ // securityDescriptionLabel
+ //
+ this.securityDescriptionLabel.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.securityDescriptionLabel.ForeColor = System.Drawing.Color.Gray;
+ this.securityDescriptionLabel.Location = new System.Drawing.Point(107, 358);
+ this.securityDescriptionLabel.Name = "securityDescriptionLabel";
+ this.securityDescriptionLabel.Size = new System.Drawing.Size(338, 31);
+ this.securityDescriptionLabel.TabIndex = 9;
+ this.securityDescriptionLabel.Text = "Enter the password for the root account. Please remember to store this password " +
+ "in a secure place.";
+ //
+ // pictureBox5
+ //
+ this.pictureBox5.Image = Resources.fading_divider;
+ this.pictureBox5.Location = new System.Drawing.Point(0, 196);
+ this.pictureBox5.Name = "pictureBox5";
+ this.pictureBox5.Size = new System.Drawing.Size(490, 15);
+ this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox5.TabIndex = 10;
+ this.pictureBox5.TabStop = false;
+ //
+ // portNumber
+ //
+ this.portNumber.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.portNumber.Location = new System.Drawing.Point(259, 170);
+ this.portNumber.Name = "portNumber";
+ this.portNumber.Size = new System.Drawing.Size(97, 21);
+ this.portNumber.TabIndex = 1;
+ this.portNumber.Text = "3306";
+ this.portNumber.TextChanged += new System.EventHandler(this.portNumber_TextChanged);
+ //
+ // portLabel
+ //
+ this.portLabel.AutoSize = true;
+ this.portLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.portLabel.Location = new System.Drawing.Point(107, 173);
+ this.portLabel.Name = "portLabel";
+ this.portLabel.Size = new System.Drawing.Size(81, 13);
+ this.portLabel.TabIndex = 12;
+ this.portLabel.Text = "Port Number:";
+ //
+ // serviceLabel
+ //
+ this.serviceLabel.AutoSize = true;
+ this.serviceLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.serviceLabel.Location = new System.Drawing.Point(107, 285);
+ this.serviceLabel.Name = "serviceLabel";
+ this.serviceLabel.Size = new System.Drawing.Size(140, 13);
+ this.serviceLabel.TabIndex = 15;
+ this.serviceLabel.Text = "Windows Service Name:";
+ //
+ // serviceName
+ //
+ this.serviceName.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.serviceName.Location = new System.Drawing.Point(259, 281);
+ this.serviceName.Name = "serviceName";
+ this.serviceName.Size = new System.Drawing.Size(162, 21);
+ this.serviceName.TabIndex = 2;
+ this.serviceName.TextChanged += new System.EventHandler(this.serviceName_TextChanged);
+ //
+ // pictureBox6
+ //
+ this.pictureBox6.Image = Resources.fading_divider;
+ this.pictureBox6.Location = new System.Drawing.Point(0, 307);
+ this.pictureBox6.Name = "pictureBox6";
+ this.pictureBox6.Size = new System.Drawing.Size(490, 15);
+ this.pictureBox6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox6.TabIndex = 17;
+ this.pictureBox6.TabStop = false;
+ //
+ // securitySettingsLabel
+ //
+ this.securitySettingsLabel.AutoSize = true;
+ this.securitySettingsLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.securitySettingsLabel.Location = new System.Drawing.Point(33, 330);
+ this.securitySettingsLabel.Name = "securitySettingsLabel";
+ this.securitySettingsLabel.Size = new System.Drawing.Size(104, 13);
+ this.securitySettingsLabel.TabIndex = 18;
+ this.securitySettingsLabel.Text = "Security Settings";
+ //
+ // passwordLabel
+ //
+ this.passwordLabel.AutoSize = true;
+ this.passwordLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.passwordLabel.Location = new System.Drawing.Point(107, 396);
+ this.passwordLabel.Name = "passwordLabel";
+ this.passwordLabel.Size = new System.Drawing.Size(135, 13);
+ this.passwordLabel.TabIndex = 20;
+ this.passwordLabel.Text = "MySQL Root Password:";
+ //
+ // rootPassword
+ //
+ this.rootPassword.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.rootPassword.Location = new System.Drawing.Point(259, 392);
+ this.rootPassword.Name = "rootPassword";
+ this.rootPassword.Size = new System.Drawing.Size(162, 21);
+ this.rootPassword.TabIndex = 4;
+ this.rootPassword.UseSystemPasswordChar = true;
+ this.rootPassword.TextChanged += new System.EventHandler(this.rootPassword_TextChanged);
+ //
+ // repeatPasswordLabel
+ //
+ this.repeatPasswordLabel.AutoSize = true;
+ this.repeatPasswordLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.repeatPasswordLabel.Location = new System.Drawing.Point(107, 422);
+ this.repeatPasswordLabel.Name = "repeatPasswordLabel";
+ this.repeatPasswordLabel.Size = new System.Drawing.Size(108, 13);
+ this.repeatPasswordLabel.TabIndex = 22;
+ this.repeatPasswordLabel.Text = "Repeat Password:";
+ //
+ // rootPasswordRepeat
+ //
+ this.rootPasswordRepeat.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.rootPasswordRepeat.Location = new System.Drawing.Point(259, 418);
+ this.rootPasswordRepeat.Name = "rootPasswordRepeat";
+ this.rootPasswordRepeat.Size = new System.Drawing.Size(162, 21);
+ this.rootPasswordRepeat.TabIndex = 5;
+ this.rootPasswordRepeat.UseSystemPasswordChar = true;
+ this.rootPasswordRepeat.TextChanged += new System.EventHandler(this.rootPasswordRepeat_TextChanged);
+ //
+ // portErrorSign
+ //
+ this.portErrorSign.Cursor = System.Windows.Forms.Cursors.SizeAll;
+ this.portErrorSign.Image = Resources.warning_sign;
+ this.portErrorSign.Location = new System.Drawing.Point(453, 169);
+ this.portErrorSign.Name = "portErrorSign";
+ this.portErrorSign.Size = new System.Drawing.Size(16, 16);
+ this.portErrorSign.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.portErrorSign.TabIndex = 24;
+ this.portErrorSign.TabStop = false;
+ this.portErrorSign.Visible = false;
+ //
+ // rootPwdErrorSign
+ //
+ this.rootPwdErrorSign.Image = Resources.warning_sign;
+ this.rootPwdErrorSign.Location = new System.Drawing.Point(453, 420);
+ this.rootPwdErrorSign.Name = "rootPwdErrorSign";
+ this.rootPwdErrorSign.Size = new System.Drawing.Size(16, 16);
+ this.rootPwdErrorSign.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.rootPwdErrorSign.TabIndex = 26;
+ this.rootPwdErrorSign.TabStop = false;
+ //
+ // rootPasswordError
+ //
+ this.rootPasswordError.AutoSize = true;
+ this.rootPasswordError.BackColor = System.Drawing.Color.Transparent;
+ this.rootPasswordError.Location = new System.Drawing.Point(280, 461);
+ this.rootPasswordError.Name = "rootPasswordError";
+ this.rootPasswordError.Size = new System.Drawing.Size(0, 13);
+ this.rootPasswordError.TabIndex = 25;
+ this.rootPasswordError.Visible = false;
+ //
+ // serviceErrorSign
+ //
+ this.serviceErrorSign.Image = Resources.warning_sign;
+ this.serviceErrorSign.Location = new System.Drawing.Point(453, 284);
+ this.serviceErrorSign.Name = "serviceErrorSign";
+ this.serviceErrorSign.Size = new System.Drawing.Size(16, 16);
+ this.serviceErrorSign.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.serviceErrorSign.TabIndex = 27;
+ this.serviceErrorSign.TabStop = false;
+ this.serviceErrorSign.Visible = false;
+ //
+ // existingPasswordLabel
+ //
+ this.existingPasswordLabel.AutoSize = true;
+ this.existingPasswordLabel.Enabled = false;
+ this.existingPasswordLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.existingPasswordLabel.Location = new System.Drawing.Point(107, 396);
+ this.existingPasswordLabel.Name = "existingPasswordLabel";
+ this.existingPasswordLabel.Size = new System.Drawing.Size(140, 13);
+ this.existingPasswordLabel.TabIndex = 29;
+ this.existingPasswordLabel.Text = "Current Root Password:";
+ //
+ // existingRootPassword
+ //
+ this.existingRootPassword.Enabled = false;
+ this.existingRootPassword.Font = new System.Drawing.Font("Tahoma", 8.25F);
+ this.existingRootPassword.Location = new System.Drawing.Point(259, 392);
+ this.existingRootPassword.Name = "existingRootPassword";
+ this.existingRootPassword.Size = new System.Drawing.Size(162, 21);
+ this.existingRootPassword.TabIndex = 3;
+ this.existingRootPassword.TabStop = false;
+ this.existingRootPassword.UseSystemPasswordChar = true;
+ //
+ // createService
+ //
+ this.createService.AutoSize = true;
+ this.createService.Checked = true;
+ this.createService.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.createService.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.createService.Location = new System.Drawing.Point(15, 215);
+ this.createService.Name = "createService";
+ this.createService.Size = new System.Drawing.Size(162, 17);
+ this.createService.TabIndex = 30;
+ this.createService.Text = "&Create Windows Service";
+ this.createService.UseVisualStyleBackColor = true;
+ this.createService.CheckedChanged += new System.EventHandler(this.createService_CheckedChanged);
+ //
+ // ServerConfigStep2
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.serviceErrorSign);
+ this.Controls.Add(this.rootPwdErrorSign);
+ this.Controls.Add(this.rootPasswordError);
+ this.Controls.Add(this.portErrorSign);
+ this.Controls.Add(this.repeatPasswordLabel);
+ this.Controls.Add(this.rootPasswordRepeat);
+ this.Controls.Add(this.securitySettingsLabel);
+ this.Controls.Add(this.pictureBox6);
+ this.Controls.Add(this.serviceLabel);
+ this.Controls.Add(this.serviceName);
+ this.Controls.Add(this.portLabel);
+ this.Controls.Add(this.portNumber);
+ this.Controls.Add(this.pictureBox5);
+ this.Controls.Add(this.securityDescriptionLabel);
+ this.Controls.Add(this.serviceDescriptionLabel);
+ this.Controls.Add(this.networkingDescriptionLabel);
+ this.Controls.Add(this.enableTCPIP);
+ this.Controls.Add(this.pictureBox4);
+ this.Controls.Add(this.pictureBox3);
+ this.Controls.Add(this.actionLabel);
+ this.Controls.Add(this.pictureBox2);
+ this.Controls.Add(this.passwordLabel);
+ this.Controls.Add(this.existingPasswordLabel);
+ this.Controls.Add(this.createService);
+ this.Controls.Add(this.rootPassword);
+ this.Controls.Add(this.existingRootPassword);
+ this.DoubleBuffered = true;
+ this.Name = "ServerConfigStep2";
+ this.Size = new System.Drawing.Size(560, 499);
+ this.Controls.SetChildIndex(this.existingRootPassword, 0);
+ this.Controls.SetChildIndex(this.rootPassword, 0);
+ this.Controls.SetChildIndex(this.createService, 0);
+ this.Controls.SetChildIndex(this.existingPasswordLabel, 0);
+ this.Controls.SetChildIndex(this.passwordLabel, 0);
+ this.Controls.SetChildIndex(this.pictureBox2, 0);
+ this.Controls.SetChildIndex(this.actionLabel, 0);
+ this.Controls.SetChildIndex(this.pictureBox3, 0);
+ this.Controls.SetChildIndex(this.pictureBox4, 0);
+ this.Controls.SetChildIndex(this.enableTCPIP, 0);
+ this.Controls.SetChildIndex(this.networkingDescriptionLabel, 0);
+ this.Controls.SetChildIndex(this.serviceDescriptionLabel, 0);
+ this.Controls.SetChildIndex(this.securityDescriptionLabel, 0);
+ this.Controls.SetChildIndex(this.pictureBox5, 0);
+ this.Controls.SetChildIndex(this.portNumber, 0);
+ this.Controls.SetChildIndex(this.portLabel, 0);
+ this.Controls.SetChildIndex(this.serviceName, 0);
+ this.Controls.SetChildIndex(this.serviceLabel, 0);
+ this.Controls.SetChildIndex(this.pictureBox6, 0);
+ this.Controls.SetChildIndex(this.securitySettingsLabel, 0);
+ this.Controls.SetChildIndex(this.rootPasswordRepeat, 0);
+ this.Controls.SetChildIndex(this.repeatPasswordLabel, 0);
+ this.Controls.SetChildIndex(this.portErrorSign, 0);
+ this.Controls.SetChildIndex(this.rootPasswordError, 0);
+ this.Controls.SetChildIndex(this.rootPwdErrorSign, 0);
+ this.Controls.SetChildIndex(this.serviceErrorSign, 0);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.portErrorSign)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.rootPwdErrorSign)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.serviceErrorSign)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label actionLabel;
+ private System.Windows.Forms.PictureBox pictureBox2;
+ private System.Windows.Forms.PictureBox pictureBox3;
+ private System.Windows.Forms.PictureBox pictureBox4;
+ private System.Windows.Forms.CheckBox enableTCPIP;
+ private System.Windows.Forms.Label networkingDescriptionLabel;
+ private System.Windows.Forms.Label serviceDescriptionLabel;
+ private System.Windows.Forms.Label securityDescriptionLabel;
+ private System.Windows.Forms.PictureBox pictureBox5;
+ private System.Windows.Forms.TextBox portNumber;
+ private System.Windows.Forms.Label portLabel;
+ private System.Windows.Forms.Label serviceLabel;
+ private System.Windows.Forms.TextBox serviceName;
+ private System.Windows.Forms.PictureBox pictureBox6;
+ private System.Windows.Forms.Label securitySettingsLabel;
+ private System.Windows.Forms.Label passwordLabel;
+ private System.Windows.Forms.TextBox rootPassword;
+ private System.Windows.Forms.Label repeatPasswordLabel;
+ private System.Windows.Forms.TextBox rootPasswordRepeat;
+ private System.Windows.Forms.PictureBox portErrorSign;
+ private System.Windows.Forms.ToolTip portTip;
+ private System.Windows.Forms.PictureBox rootPwdErrorSign;
+ private System.Windows.Forms.ToolTip rootPwdTip;
+ private System.Windows.Forms.Label rootPasswordError;
+ private System.Windows.Forms.PictureBox serviceErrorSign;
+ private System.Windows.Forms.ToolTip serviceTip;
+ private System.Windows.Forms.Label existingPasswordLabel;
+ private System.Windows.Forms.TextBox existingRootPassword;
+ private System.Windows.Forms.CheckBox createService;
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel2.cs'
--- a/StandardPlugins/ServerConfigPanel2.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel2.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,226 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using System.Globalization;
+using System.Net.NetworkInformation;
+using System.ServiceProcess;
+using System.Net;
+
+namespace WexInstaller.Plugins
+{
+ public partial class ServerConfigStep2 : InstallerPanel
+ {
+ public ServerConfigStep2(ServerConfigurationController controller)
+ {
+ InitializeComponent();
+ Caption = "MySQL Server Configuration";
+ Controller = controller;
+
+ portTip = new ToolTip();
+ portTip.SetToolTip(portErrorSign, "The port is in-use.");
+
+ serviceTip = new ToolTip();
+ serviceTip.SetToolTip(serviceErrorSign, "The service name is in use.");
+
+ rootPwdTip = new ToolTip();
+ }
+
+ private ServerConfigurationController Controller { get; set; }
+
+ public override bool Next()
+ {
+ (ParentControl as InstallWizardControl).ShowConfigOverviewPage();
+ return false;
+ }
+
+ private void portNumber_TextChanged(object sender, EventArgs e)
+ {
+ int port = 0;
+ try
+ {
+ port = Int32.Parse(portNumber.Text.Trim(), CultureInfo.InvariantCulture);
+ if (port > 0 && PortIsAvailable(port))
+ Controller.Port = port;
+ }
+ catch (Exception)
+ {
+ port = 0;
+ }
+ portErrorSign.Visible = port <= 0;
+ SignalChange();
+ }
+
+ private bool PortIsAvailable(int port)
+ {
+ // Evaluate current system tcp connections. This is the same information provided
+ // by the netstat command line application, just in .Net strongly-typed object
+ // form. We will look through the list, and if our port we would like to use
+ // in our TcpClient is occupied, we will set isAvailable to false.
+ IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties();
+
+ // test active listeners
+ IPEndPoint[] endPoints = ipGlobalProperties.GetActiveTcpListeners();
+ foreach (IPEndPoint endPoint in endPoints)
+ if (endPoint.Port == port) return false;
+
+ return true;
+ }
+
+ public override void Activate()
+ {
+ if (Controller.it != null && Controller.it.Reconfiguring)
+ {
+ enableTCPIP.Checked = Controller.it.EnableNetworking;
+ if (enableTCPIP.Checked)
+ {
+ portNumber.Text = Controller.it.Port;
+ }
+
+ if (!String.IsNullOrEmpty(Controller.ServiceName))
+ {
+ serviceName.Text = Controller.ServiceName;
+ serviceName.Enabled = false;
+ serviceErrorSign.Visible = false;
+ createService.Checked = true;
+ createService.Enabled = false;
+ }
+ }
+
+ if (Controller.it != null && (Controller.it.Reconfiguring || Controller.it.FoundExistingDataDir))
+ {
+
+ passwordLabel.Location = new Point(passwordLabel.Location.X, passwordLabel.Location.Y + 26);
+ repeatPasswordLabel.Location = new Point(repeatPasswordLabel.Location.X, repeatPasswordLabel.Location.Y + 26);
+
+ rootPassword.Location = new Point(rootPassword.Location.X, rootPassword.Location.Y + 26);
+ rootPasswordRepeat.Location = new Point(rootPasswordRepeat.Location.X, rootPasswordRepeat.Location.Y + 26);
+ rootPwdErrorSign.Location = new Point(rootPwdErrorSign.Location.X, rootPwdErrorSign.Location.Y + 26);
+
+ existingPasswordLabel.Enabled = true;
+ existingRootPassword.Enabled = true;
+ existingRootPassword.TabStop = true;
+ }
+
+ Controller.CreateService = createService.Checked;
+
+ CheckPasswords();
+ SetDefaultServiceName();
+
+
+ int currentPort = Int32.Parse(portNumber.Text.Trim(), CultureInfo.InvariantCulture);
+ while (!PortIsAvailable(currentPort))
+ {
+ currentPort += 1;
+ }
+ portNumber.Text = currentPort.ToString();
+
+ base.Activate();
+ }
+
+ public override bool NextOk()
+ {
+ if (portErrorSign.Visible) return false;
+ if (rootPwdErrorSign.Visible) return false;
+ if (serviceErrorSign.Visible) return false;
+ return true;
+ }
+
+ private void serviceName_TextChanged(object sender, EventArgs e)
+ {
+ serviceErrorSign.Visible = false;
+
+ string name = serviceName.Text.Trim();
+ bool bad = createService.Checked && name.Length == 0;
+ bad = bad || name.Length > 0 && (!ServiceNameAvailable(name) && !Controller.it.Reconfiguring);
+ serviceErrorSign.Visible = bad;
+ Controller.ServiceName = bad ? String.Empty : name;
+ SignalChange();
+ }
+
+ private bool ServiceNameAvailable(string name)
+ {
+ ServiceController[] services = ServiceController.GetServices();
+ foreach (ServiceController service in services)
+ if (service.ServiceName == name) return false;
+ return true;
+ }
+
+ private void rootPasswordRepeat_TextChanged(object sender, EventArgs e)
+ {
+ CheckPasswords();
+ }
+
+ private void rootPassword_TextChanged(object sender, EventArgs e)
+ {
+ CheckPasswords();
+ }
+
+ private void CheckPasswords()
+ {
+ Controller.RootPassword = null;
+ string root = rootPassword.Text.Trim();
+ string repeat = rootPasswordRepeat.Text.Trim();
+ Controller.RootPassword = null;
+ rootPwdErrorSign.Visible = false;
+ if (root != repeat && (root.Length > 0 || repeat.Length > 0))
+ {
+ rootPwdErrorSign.Visible = true;
+ rootPwdTip.SetToolTip(rootPwdErrorSign, "The passwords do not match.");
+ }
+ else if (root.Length < 4 && repeat.Length < 4)
+ {
+ rootPwdErrorSign.Visible = true;
+ rootPwdTip.SetToolTip(rootPwdErrorSign, "The passwords do not meet the minimum length requirment.");
+ }
+ else
+ {
+ if (existingRootPassword.Enabled)
+ Controller.ExistingRootPassword = existingRootPassword.Text;
+ Controller.RootPassword = root;
+ }
+ SignalChange();
+ }
+
+ private void SetDefaultServiceName()
+ {
+ // Set a default service name
+ string defaultServiceName = String.Empty;
+
+ if (String.IsNullOrEmpty(Controller.ServiceName) == false)
+ defaultServiceName = Controller.ServiceName;
+
+ if (Controller.it != null && !Controller.it.Reconfiguring && defaultServiceName != String.Empty)
+ {
+ int i = 0;
+ while (ServiceNameAvailable(defaultServiceName) == false)
+ {
+ i++;
+ defaultServiceName = String.Format("{0}_{1}", Controller.ServiceName, i.ToString());
+ }
+ }
+
+ serviceName.Text = defaultServiceName;
+ }
+
+ private void enableTCPIP_CheckedChanged(object sender, EventArgs e)
+ {
+ portNumber.Enabled = enableTCPIP.Checked;
+ Controller.EnableTCPIP = enableTCPIP.Checked;
+ portNumber_TextChanged(null, null);
+ SignalChange();
+ }
+
+ private void createService_CheckedChanged(object sender, EventArgs e)
+ {
+ serviceName.Enabled = createService.Checked;
+ Controller.CreateService = createService.Checked;
+ serviceName_TextChanged(null, null);
+ SignalChange();
+ }
+
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel2.resx'
--- a/StandardPlugins/ServerConfigPanel2.resx 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel2.resx 2011-02-07 21:39:05 +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
=== added file 'StandardPlugins/ServerConfigPanel3.Designer.cs'
--- a/StandardPlugins/ServerConfigPanel3.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel3.Designer.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,123 @@
+using WexInstaller.Plugins.Properties;
+
+namespace WexInstaller.Plugins
+{
+ partial class ServerConfigStep3
+ {
+ /// <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.actionLabel = new System.Windows.Forms.Label();
+ this.pictureBox2 = new System.Windows.Forms.PictureBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.configText = new System.Windows.Forms.TextBox();
+ this.copyToClipboard = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+ this.SuspendLayout();
+ //
+ // actionLabel
+ //
+ this.actionLabel.AutoSize = true;
+ this.actionLabel.Font = new System.Drawing.Font("Tahoma", 10F);
+ this.actionLabel.Location = new System.Drawing.Point(12, 80);
+ this.actionLabel.Name = "actionLabel";
+ this.actionLabel.Size = new System.Drawing.Size(251, 17);
+ this.actionLabel.TabIndex = 3;
+ this.actionLabel.Text = "Please review the Configuration Settings";
+ //
+ // pictureBox2
+ //
+ this.pictureBox2.Image = Resources.server_confirm;
+ this.pictureBox2.Location = new System.Drawing.Point(15, 114);
+ this.pictureBox2.Name = "pictureBox2";
+ this.pictureBox2.Size = new System.Drawing.Size(52, 50);
+ this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox2.TabIndex = 4;
+ this.pictureBox2.TabStop = false;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
+ this.label2.Location = new System.Drawing.Point(69, 114);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(215, 13);
+ this.label2.TabIndex = 5;
+ this.label2.Text = "MySQL Server Configuration Settings";
+ //
+ // configText
+ //
+ this.configText.BackColor = System.Drawing.Color.White;
+ this.configText.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.configText.Location = new System.Drawing.Point(71, 141);
+ this.configText.Multiline = true;
+ this.configText.Name = "configText";
+ this.configText.ReadOnly = true;
+ this.configText.Size = new System.Drawing.Size(350, 248);
+ this.configText.TabIndex = 6;
+ //
+ // copyToClipboard
+ //
+ this.copyToClipboard.Location = new System.Drawing.Point(15, 408);
+ this.copyToClipboard.Name = "copyToClipboard";
+ this.copyToClipboard.Size = new System.Drawing.Size(107, 26);
+ this.copyToClipboard.TabIndex = 7;
+ this.copyToClipboard.Text = "C&opy to Clipboard";
+ this.copyToClipboard.UseVisualStyleBackColor = true;
+ this.copyToClipboard.Click += new System.EventHandler(this.copyToClipboard_Click);
+ //
+ // ServerConfigStep3
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.copyToClipboard);
+ this.Controls.Add(this.configText);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.pictureBox2);
+ this.Controls.Add(this.actionLabel);
+ this.DoubleBuffered = true;
+ this.Name = "ServerConfigStep3";
+ this.Size = new System.Drawing.Size(560, 499);
+ this.Controls.SetChildIndex(this.actionLabel, 0);
+ this.Controls.SetChildIndex(this.pictureBox2, 0);
+ this.Controls.SetChildIndex(this.label2, 0);
+ this.Controls.SetChildIndex(this.configText, 0);
+ this.Controls.SetChildIndex(this.copyToClipboard, 0);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label actionLabel;
+ private System.Windows.Forms.PictureBox pictureBox2;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox configText;
+ private System.Windows.Forms.Button copyToClipboard;
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel3.cs'
--- a/StandardPlugins/ServerConfigPanel3.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel3.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,54 @@
+ïing System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace WexInstaller.Plugins
+{
+ public partial class ServerConfigStep3 : InstallerPanel
+ {
+ private bool nextOk;
+ private bool backOk;
+
+ public ServerConfigStep3(ServerConfigurationController controller)
+ {
+ InitializeComponent();
+ Caption = "MySQL Server Configuration";
+ Controller = controller;
+ nextOk = true;
+ backOk = true;
+ }
+
+ private ServerConfigurationController Controller { get; set; }
+
+ public override void Activate()
+ {
+ configText.Text = Controller.GetConfigurationAsText();
+ base.Activate();
+ }
+
+ public override bool NextOk()
+ {
+ return nextOk;
+ }
+
+ public override bool BackOk()
+ {
+ return backOk;
+ }
+
+ public override bool Next()
+ {
+ (ParentControl as InstallWizardControl).ShowConfigOverviewPage();
+ return false;
+ }
+
+ private void copyToClipboard_Click(object sender, EventArgs e)
+ {
+ Clipboard.SetText(configText.Text);
+ }
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel3.resx'
--- a/StandardPlugins/ServerConfigPanel3.resx 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel3.resx 2011-02-07 21:39:05 +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
=== added file 'StandardPlugins/ServerConfigPanel4.Designer.cs'
--- a/StandardPlugins/ServerConfigPanel4.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel4.Designer.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,332 @@
+using WexInstaller.Plugins.Properties;
+namespace WexInstaller.Plugins
+{
+ partial class ServerConfigAction
+ {
+ /// <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.actionLabel = new System.Windows.Forms.Label();
+ this.validEmptyIcon = new System.Windows.Forms.PictureBox();
+ this.validLabel = new System.Windows.Forms.Label();
+ this.templateEmptyIcon = new System.Windows.Forms.PictureBox();
+ this.templateLabel = new System.Windows.Forms.Label();
+ this.serviceEmptyIcon = new System.Windows.Forms.PictureBox();
+ this.verifyEmptyIcon = new System.Windows.Forms.PictureBox();
+ this.serviceLabel = new System.Windows.Forms.Label();
+ this.verifyLabel = new System.Windows.Forms.Label();
+ this.updateLabel = new System.Windows.Forms.Label();
+ this.actionFailedIcon = new System.Windows.Forms.PictureBox();
+ this.currentActionIcon = new System.Windows.Forms.PictureBox();
+ this.validSuccessIcon = new System.Windows.Forms.PictureBox();
+ this.templateSuccessIcon = new System.Windows.Forms.PictureBox();
+ this.serviceSuccessIcon = new System.Windows.Forms.PictureBox();
+ this.verifySuccessIcon = new System.Windows.Forms.PictureBox();
+ this.updateSuccessIcon = new System.Windows.Forms.PictureBox();
+ this.updateEmptyIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.validEmptyIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.templateEmptyIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.serviceEmptyIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.verifyEmptyIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.actionFailedIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.currentActionIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.validSuccessIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.templateSuccessIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.serviceSuccessIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.verifySuccessIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.updateSuccessIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.updateEmptyIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // actionLabel
+ //
+ this.actionLabel.AutoSize = true;
+ this.actionLabel.Font = new System.Drawing.Font("Tahoma", 10F);
+ this.actionLabel.Location = new System.Drawing.Point(12, 80);
+ this.actionLabel.Name = "actionLabel";
+ this.actionLabel.Size = new System.Drawing.Size(390, 17);
+ this.actionLabel.TabIndex = 9;
+ this.actionLabel.Text = "Create the configuration and start the MySQL Server Instance.";
+ //
+ // validEmptyIcon
+ //
+ this.validEmptyIcon.Image = Resources.ActionOpen;
+ this.validEmptyIcon.Location = new System.Drawing.Point(15, 122);
+ this.validEmptyIcon.Name = "validEmptyIcon";
+ this.validEmptyIcon.Size = new System.Drawing.Size(12, 14);
+ this.validEmptyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.validEmptyIcon.TabIndex = 10;
+ this.validEmptyIcon.TabStop = false;
+ //
+ // validLabel
+ //
+ this.validLabel.AutoSize = true;
+ this.validLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.validLabel.Location = new System.Drawing.Point(34, 122);
+ this.validLabel.Name = "validLabel";
+ this.validLabel.Size = new System.Drawing.Size(113, 13);
+ this.validLabel.TabIndex = 11;
+ this.validLabel.Text = "Locate valid template.";
+ //
+ // templateEmptyIcon
+ //
+ this.templateEmptyIcon.Image = Resources.ActionOpen;
+ this.templateEmptyIcon.Location = new System.Drawing.Point(15, 142);
+ this.templateEmptyIcon.Name = "templateEmptyIcon";
+ this.templateEmptyIcon.Size = new System.Drawing.Size(12, 14);
+ this.templateEmptyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.templateEmptyIcon.TabIndex = 12;
+ this.templateEmptyIcon.TabStop = false;
+ //
+ // templateLabel
+ //
+ this.templateLabel.AutoSize = true;
+ this.templateLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.templateLabel.Location = new System.Drawing.Point(34, 142);
+ this.templateLabel.Name = "templateLabel";
+ this.templateLabel.Size = new System.Drawing.Size(93, 13);
+ this.templateLabel.TabIndex = 13;
+ this.templateLabel.Text = "Process template.";
+ //
+ // serviceEmptyIcon
+ //
+ this.serviceEmptyIcon.Image = Resources.ActionOpen;
+ this.serviceEmptyIcon.Location = new System.Drawing.Point(15, 162);
+ this.serviceEmptyIcon.Name = "serviceEmptyIcon";
+ this.serviceEmptyIcon.Size = new System.Drawing.Size(12, 14);
+ this.serviceEmptyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.serviceEmptyIcon.TabIndex = 14;
+ this.serviceEmptyIcon.TabStop = false;
+ //
+ // verifyEmptyIcon
+ //
+ this.verifyEmptyIcon.Image = Resources.ActionOpen;
+ this.verifyEmptyIcon.Location = new System.Drawing.Point(15, 183);
+ this.verifyEmptyIcon.Name = "verifyEmptyIcon";
+ this.verifyEmptyIcon.Size = new System.Drawing.Size(12, 14);
+ this.verifyEmptyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.verifyEmptyIcon.TabIndex = 15;
+ this.verifyEmptyIcon.TabStop = false;
+ //
+ // serviceLabel
+ //
+ this.serviceLabel.AutoSize = true;
+ this.serviceLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.serviceLabel.Location = new System.Drawing.Point(34, 162);
+ this.serviceLabel.Name = "serviceLabel";
+ this.serviceLabel.Size = new System.Drawing.Size(95, 13);
+ this.serviceLabel.TabIndex = 16;
+ this.serviceLabel.Text = "Configure service.";
+ //
+ // verifyLabel
+ //
+ this.verifyLabel.AutoSize = true;
+ this.verifyLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.verifyLabel.Location = new System.Drawing.Point(34, 183);
+ this.verifyLabel.Name = "verifyLabel";
+ this.verifyLabel.Size = new System.Drawing.Size(125, 13);
+ this.verifyLabel.TabIndex = 17;
+ this.verifyLabel.Text = "Verify service is running.";
+ //
+ // updateLabel
+ //
+ this.updateLabel.AutoSize = true;
+ this.updateLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.updateLabel.Location = new System.Drawing.Point(34, 203);
+ this.updateLabel.Name = "updateLabel";
+ this.updateLabel.Size = new System.Drawing.Size(128, 13);
+ this.updateLabel.TabIndex = 19;
+ this.updateLabel.Text = "Update security settings.";
+ //
+ // actionFailedIcon
+ //
+ this.actionFailedIcon.Image = Resources.ActionError;
+ this.actionFailedIcon.Location = new System.Drawing.Point(15, 122);
+ this.actionFailedIcon.Name = "actionFailedIcon";
+ this.actionFailedIcon.Size = new System.Drawing.Size(12, 14);
+ this.actionFailedIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.actionFailedIcon.TabIndex = 20;
+ this.actionFailedIcon.TabStop = false;
+ this.actionFailedIcon.Visible = false;
+ //
+ // currentActionIcon
+ //
+ this.currentActionIcon.Image = Resources.ActionCurrent;
+ this.currentActionIcon.Location = new System.Drawing.Point(15, 122);
+ this.currentActionIcon.Name = "currentActionIcon";
+ this.currentActionIcon.Size = new System.Drawing.Size(12, 14);
+ this.currentActionIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.currentActionIcon.TabIndex = 21;
+ this.currentActionIcon.TabStop = false;
+ this.currentActionIcon.Visible = false;
+ //
+ // validSuccessIcon
+ //
+ this.validSuccessIcon.Image = Resources.ActionDone;
+ this.validSuccessIcon.Location = new System.Drawing.Point(15, 122);
+ this.validSuccessIcon.Name = "validSuccessIcon";
+ this.validSuccessIcon.Size = new System.Drawing.Size(14, 14);
+ this.validSuccessIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.validSuccessIcon.TabIndex = 22;
+ this.validSuccessIcon.TabStop = false;
+ this.validSuccessIcon.Visible = false;
+ //
+ // templateSuccessIcon
+ //
+ this.templateSuccessIcon.Image = Resources.ActionDone;
+ this.templateSuccessIcon.Location = new System.Drawing.Point(15, 142);
+ this.templateSuccessIcon.Name = "templateSuccessIcon";
+ this.templateSuccessIcon.Size = new System.Drawing.Size(14, 14);
+ this.templateSuccessIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.templateSuccessIcon.TabIndex = 23;
+ this.templateSuccessIcon.TabStop = false;
+ this.templateSuccessIcon.Visible = false;
+ //
+ // serviceSuccessIcon
+ //
+ this.serviceSuccessIcon.Image = Resources.ActionDone;
+ this.serviceSuccessIcon.Location = new System.Drawing.Point(15, 162);
+ this.serviceSuccessIcon.Name = "serviceSuccessIcon";
+ this.serviceSuccessIcon.Size = new System.Drawing.Size(14, 14);
+ this.serviceSuccessIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.serviceSuccessIcon.TabIndex = 24;
+ this.serviceSuccessIcon.TabStop = false;
+ this.serviceSuccessIcon.Visible = false;
+ //
+ // verifySuccessIcon
+ //
+ this.verifySuccessIcon.Image = Resources.ActionDone;
+ this.verifySuccessIcon.Location = new System.Drawing.Point(15, 183);
+ this.verifySuccessIcon.Name = "verifySuccessIcon";
+ this.verifySuccessIcon.Size = new System.Drawing.Size(14, 14);
+ this.verifySuccessIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.verifySuccessIcon.TabIndex = 25;
+ this.verifySuccessIcon.TabStop = false;
+ this.verifySuccessIcon.Visible = false;
+ //
+ // updateSuccessIcon
+ //
+ this.updateSuccessIcon.Image = Resources.ActionDone;
+ this.updateSuccessIcon.Location = new System.Drawing.Point(15, 203);
+ this.updateSuccessIcon.Name = "updateSuccessIcon";
+ this.updateSuccessIcon.Size = new System.Drawing.Size(14, 14);
+ this.updateSuccessIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.updateSuccessIcon.TabIndex = 26;
+ this.updateSuccessIcon.TabStop = false;
+ this.updateSuccessIcon.Visible = false;
+ //
+ // updateEmptyIcon
+ //
+ this.updateEmptyIcon.Image = Resources.ActionOpen;
+ this.updateEmptyIcon.Location = new System.Drawing.Point(15, 203);
+ this.updateEmptyIcon.Name = "updateEmptyIcon";
+ this.updateEmptyIcon.Size = new System.Drawing.Size(12, 14);
+ this.updateEmptyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.updateEmptyIcon.TabIndex = 18;
+ this.updateEmptyIcon.TabStop = false;
+ //
+ // ServerConfigAction
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.updateLabel);
+ this.Controls.Add(this.verifyLabel);
+ this.Controls.Add(this.serviceLabel);
+ this.Controls.Add(this.templateLabel);
+ this.Controls.Add(this.validLabel);
+ this.Controls.Add(this.actionLabel);
+ this.Controls.Add(this.validEmptyIcon);
+ this.Controls.Add(this.validSuccessIcon);
+ this.Controls.Add(this.currentActionIcon);
+ this.Controls.Add(this.actionFailedIcon);
+ this.Controls.Add(this.templateEmptyIcon);
+ this.Controls.Add(this.templateSuccessIcon);
+ this.Controls.Add(this.serviceEmptyIcon);
+ this.Controls.Add(this.serviceSuccessIcon);
+ this.Controls.Add(this.verifyEmptyIcon);
+ this.Controls.Add(this.verifySuccessIcon);
+ this.Controls.Add(this.updateEmptyIcon);
+ this.Controls.Add(this.updateSuccessIcon);
+ this.DoubleBuffered = true;
+ this.Name = "ServerConfigAction";
+ this.Size = new System.Drawing.Size(560, 499);
+ this.Controls.SetChildIndex(this.updateSuccessIcon, 0);
+ this.Controls.SetChildIndex(this.updateEmptyIcon, 0);
+ this.Controls.SetChildIndex(this.verifySuccessIcon, 0);
+ this.Controls.SetChildIndex(this.verifyEmptyIcon, 0);
+ this.Controls.SetChildIndex(this.serviceSuccessIcon, 0);
+ this.Controls.SetChildIndex(this.serviceEmptyIcon, 0);
+ this.Controls.SetChildIndex(this.templateSuccessIcon, 0);
+ this.Controls.SetChildIndex(this.templateEmptyIcon, 0);
+ this.Controls.SetChildIndex(this.actionFailedIcon, 0);
+ this.Controls.SetChildIndex(this.currentActionIcon, 0);
+ this.Controls.SetChildIndex(this.validSuccessIcon, 0);
+ this.Controls.SetChildIndex(this.validEmptyIcon, 0);
+ this.Controls.SetChildIndex(this.actionLabel, 0);
+ this.Controls.SetChildIndex(this.validLabel, 0);
+ this.Controls.SetChildIndex(this.templateLabel, 0);
+ this.Controls.SetChildIndex(this.serviceLabel, 0);
+ this.Controls.SetChildIndex(this.verifyLabel, 0);
+ this.Controls.SetChildIndex(this.updateLabel, 0);
+ ((System.ComponentModel.ISupportInitialize)(this.validEmptyIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.templateEmptyIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.serviceEmptyIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.verifyEmptyIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.actionFailedIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.currentActionIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.validSuccessIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.templateSuccessIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.serviceSuccessIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.verifySuccessIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.updateSuccessIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.updateEmptyIcon)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label actionLabel;
+ private System.Windows.Forms.PictureBox validEmptyIcon;
+ private System.Windows.Forms.Label validLabel;
+ private System.Windows.Forms.PictureBox templateEmptyIcon;
+ private System.Windows.Forms.Label templateLabel;
+ private System.Windows.Forms.PictureBox serviceEmptyIcon;
+ private System.Windows.Forms.PictureBox verifyEmptyIcon;
+ private System.Windows.Forms.Label serviceLabel;
+ private System.Windows.Forms.Label verifyLabel;
+ private System.Windows.Forms.Label updateLabel;
+ private System.Windows.Forms.PictureBox actionFailedIcon;
+ private System.Windows.Forms.PictureBox currentActionIcon;
+ private System.Windows.Forms.PictureBox validSuccessIcon;
+ private System.Windows.Forms.PictureBox templateSuccessIcon;
+ private System.Windows.Forms.PictureBox serviceSuccessIcon;
+ private System.Windows.Forms.PictureBox verifySuccessIcon;
+ private System.Windows.Forms.PictureBox updateSuccessIcon;
+ private System.Windows.Forms.PictureBox updateEmptyIcon;
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel4.cs'
--- a/StandardPlugins/ServerConfigPanel4.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel4.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,174 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using WexInstaller.Plugins.Properties;
+using WexInstaller.Core;
+
+namespace WexInstaller.Plugins
+{
+ public partial class ServerConfigAction : InstallerPanel
+ {
+ private bool nextOk;
+ private bool backOk;
+ private bool executed;
+
+ public ServerConfigAction(ServerConfigurationController controller)
+ {
+ InitializeComponent();
+ Caption = "MySQL Server Configuration";
+ Controller = controller;
+ nextOk = true;
+ backOk = true;
+ executed = false;
+ }
+
+ public override void Activate()
+ {
+ if (!executed)
+ {
+ NextButton.Text = Resources.NextButtonExecuteText;
+ NextButton.Refresh();
+ }
+
+ serviceLabel.Visible = Controller.CreateService;
+ serviceEmptyIcon.Visible = Controller.CreateService;
+ verifyLabel.Visible = Controller.CreateService;
+ verifyEmptyIcon.Visible = Controller.CreateService;
+ updateLabel.Visible = Controller.CreateService;
+ updateEmptyIcon.Visible = Controller.CreateService;
+
+ base.Activate();
+ }
+
+ public override bool NextOk()
+ {
+ return nextOk;
+ }
+
+ public override bool BackOk()
+ {
+ return backOk;
+ }
+
+ public override bool Next()
+ {
+ if (!executed)
+ {
+ nextOk = false;
+ backOk = false;
+ SignalChange();
+
+ NextButton.Text = Resources.NextButtonDefaultText;
+ NextButton.Refresh();
+
+ // Do configuration here.
+ Controller.Configured += new ConfigurationEventHandler(ConfigurationChanged);
+ Controller.Configure();
+
+ executed = true;
+ Application.DoEvents();
+
+ return false;
+ }
+
+ return base.Next();
+ }
+
+
+ public override bool Back()
+ {
+ if (!executed)
+ {
+ NextButton.Text = Resources.NextButtonDefaultText;
+ NextButton.Refresh();
+ }
+
+ return base.Back();
+ }
+
+ private ServerConfigurationController Controller { get; set; }
+
+ private void ConfigurationChanged(object sender, ConfigurationEventArgs e)
+ {
+ switch (e.Type)
+ {
+ case (ConfigurationEventType.Info):
+ PictureBox pb = null;
+ switch (e.Action)
+ {
+ case "VALID_TEMPLATE":
+ pb = validEmptyIcon;
+ break;
+ case "PROCESS_TEMPLATE":
+ pb = templateEmptyIcon;
+ break;
+ case "CONFIGURE_SERVICE":
+ pb = serviceEmptyIcon;
+ break;
+ case "START_SERVICE":
+ pb = verifyEmptyIcon;
+ break;
+ case "SECURITY_SETTING":
+ pb = updateEmptyIcon;
+ break;
+ }
+ currentActionIcon.Location = pb.Location;
+ currentActionIcon.Visible = true;
+ currentActionIcon.BringToFront();
+ currentActionIcon.Refresh();
+ pb.Visible = false;
+ pb.Refresh();
+ break;
+ case (ConfigurationEventType.Success):
+ switch (e.Action)
+ {
+ case "VALID_TEMPLATE":
+ validSuccessIcon.Visible = true;
+ validSuccessIcon.BringToFront();
+ validSuccessIcon.Refresh();
+ break;
+ case "PROCESS_TEMPLATE":
+ templateSuccessIcon.Visible = true;
+ templateSuccessIcon.BringToFront();
+ templateSuccessIcon.Refresh();
+ break;
+ case "CONFIGURE_SERVICE":
+ serviceSuccessIcon.Visible = true;
+ serviceSuccessIcon.BringToFront();
+ serviceSuccessIcon.Refresh();
+ break;
+ case "START_SERVICE":
+ verifySuccessIcon.Visible = true;
+ verifySuccessIcon.BringToFront();
+ verifySuccessIcon.Refresh();
+ break;
+ case "SECURITY_SETTING":
+ updateSuccessIcon.Visible = true;
+ updateSuccessIcon.BringToFront();
+ updateSuccessIcon.Refresh();
+ break;
+ }
+ currentActionIcon.Visible = false;
+ currentActionIcon.Refresh();
+ break;
+ case (ConfigurationEventType.Error):
+ actionFailedIcon.Location = currentActionIcon.Location;
+ actionFailedIcon.Visible = true;
+ actionFailedIcon.BringToFront();
+ actionFailedIcon.Refresh();
+ currentActionIcon.Visible = false;
+ currentActionIcon.Refresh();
+ break;
+ case (ConfigurationEventType.Finished):
+ nextOk = true;
+ backOk = false;
+ break;
+ };
+ SignalChange();
+ }
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel4.resx'
--- a/StandardPlugins/ServerConfigPanel4.resx 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel4.resx 2011-02-07 21:39:05 +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
=== added file 'StandardPlugins/ServerConfigPanel5.Designer.cs'
--- a/StandardPlugins/ServerConfigPanel5.Designer.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel5.Designer.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,228 @@
+using WexInstaller.Plugins.Properties;
+namespace WexInstaller.Plugins
+{
+ partial class ServerConfigStep1a
+ {
+ /// <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.skipRestart = new System.Windows.Forms.CheckBox();
+ this.restartEmtpyIcon = new System.Windows.Forms.PictureBox();
+ this.restartActionLabel = new System.Windows.Forms.Label();
+ this.actionCurrentIcon = new System.Windows.Forms.PictureBox();
+ this.restartSuccessIcon = new System.Windows.Forms.PictureBox();
+ this.actionFailedIcon = new System.Windows.Forms.PictureBox();
+ this.actionLabel = new System.Windows.Forms.Label();
+ this.restartWarningIcon = new System.Windows.Forms.PictureBox();
+ this.restartWarningLabel = new System.Windows.Forms.Label();
+ this.errorList = new System.Windows.Forms.ListView();
+ this.errorHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.openConfigFile = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.restartEmtpyIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.actionCurrentIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.restartSuccessIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.actionFailedIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.restartWarningIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // skipRestart
+ //
+ this.skipRestart.AutoSize = true;
+ this.skipRestart.Location = new System.Drawing.Point(15, 423);
+ this.skipRestart.Name = "skipRestart";
+ this.skipRestart.Size = new System.Drawing.Size(260, 17);
+ this.skipRestart.TabIndex = 2;
+ this.skipRestart.Text = "&Skip. Mark this box to manually restart instance.";
+ this.skipRestart.UseVisualStyleBackColor = true;
+ this.skipRestart.CheckedChanged += new System.EventHandler(this.skipRestart_CheckedChanged);
+ //
+ // restartEmtpyIcon
+ //
+ this.restartEmtpyIcon.Image = Resources.ActionOpen;
+ this.restartEmtpyIcon.Location = new System.Drawing.Point(16, 117);
+ this.restartEmtpyIcon.Name = "restartEmtpyIcon";
+ this.restartEmtpyIcon.Size = new System.Drawing.Size(12, 14);
+ this.restartEmtpyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.restartEmtpyIcon.TabIndex = 3;
+ this.restartEmtpyIcon.TabStop = false;
+ //
+ // restartActionLabel
+ //
+ this.restartActionLabel.AutoSize = true;
+ this.restartActionLabel.Location = new System.Drawing.Point(34, 118);
+ this.restartActionLabel.Name = "restartActionLabel";
+ this.restartActionLabel.Size = new System.Drawing.Size(176, 13);
+ this.restartActionLabel.TabIndex = 4;
+ this.restartActionLabel.Text = "Attempt to restart existing service.";
+ //
+ // actionCurrentIcon
+ //
+ this.actionCurrentIcon.Image = Resources.ActionCurrent;
+ this.actionCurrentIcon.Location = new System.Drawing.Point(16, 117);
+ this.actionCurrentIcon.Name = "actionCurrentIcon";
+ this.actionCurrentIcon.Size = new System.Drawing.Size(12, 14);
+ this.actionCurrentIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.actionCurrentIcon.TabIndex = 5;
+ this.actionCurrentIcon.TabStop = false;
+ this.actionCurrentIcon.Visible = false;
+ //
+ // restartSuccessIcon
+ //
+ this.restartSuccessIcon.Image = Resources.ActionDone;
+ this.restartSuccessIcon.Location = new System.Drawing.Point(16, 117);
+ this.restartSuccessIcon.Name = "restartSuccessIcon";
+ this.restartSuccessIcon.Size = new System.Drawing.Size(14, 14);
+ this.restartSuccessIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.restartSuccessIcon.TabIndex = 6;
+ this.restartSuccessIcon.TabStop = false;
+ this.restartSuccessIcon.Visible = false;
+ //
+ // actionFailedIcon
+ //
+ this.actionFailedIcon.Image = Resources.ActionError;
+ this.actionFailedIcon.Location = new System.Drawing.Point(16, 117);
+ this.actionFailedIcon.Name = "actionFailedIcon";
+ this.actionFailedIcon.Size = new System.Drawing.Size(12, 14);
+ this.actionFailedIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.actionFailedIcon.TabIndex = 7;
+ this.actionFailedIcon.TabStop = false;
+ this.actionFailedIcon.Visible = false;
+ //
+ // actionLabel
+ //
+ this.actionLabel.AutoSize = true;
+ this.actionLabel.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.actionLabel.Location = new System.Drawing.Point(16, 75);
+ this.actionLabel.Name = "actionLabel";
+ this.actionLabel.Size = new System.Drawing.Size(328, 16);
+ this.actionLabel.TabIndex = 8;
+ this.actionLabel.Text = "Click the [Execute] button to restart the existing service.";
+ //
+ // restartWarningIcon
+ //
+ this.restartWarningIcon.Image = Resources.ActionWarning;
+ this.restartWarningIcon.Location = new System.Drawing.Point(16, 137);
+ this.restartWarningIcon.Name = "restartWarningIcon";
+ this.restartWarningIcon.Size = new System.Drawing.Size(17, 15);
+ this.restartWarningIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.restartWarningIcon.TabIndex = 9;
+ this.restartWarningIcon.TabStop = false;
+ this.restartWarningIcon.Visible = false;
+ //
+ // restartWarningLabel
+ //
+ this.restartWarningLabel.AutoSize = true;
+ this.restartWarningLabel.Location = new System.Drawing.Point(37, 137);
+ this.restartWarningLabel.Name = "restartWarningLabel";
+ this.restartWarningLabel.Size = new System.Drawing.Size(98, 13);
+ this.restartWarningLabel.TabIndex = 10;
+ this.restartWarningLabel.Text = "Errors in Event Log";
+ this.restartWarningLabel.Visible = false;
+ //
+ // errorList
+ //
+ this.errorList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.errorList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.errorHeader});
+ this.errorList.Location = new System.Drawing.Point(37, 179);
+ this.errorList.Name = "errorList";
+ this.errorList.Size = new System.Drawing.Size(143, 202);
+ this.errorList.TabIndex = 11;
+ this.errorList.UseCompatibleStateImageBehavior = false;
+ this.errorList.View = System.Windows.Forms.View.Details;
+ this.errorList.Visible = false;
+ this.errorList.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.errorList_ItemSelectionChanged);
+ //
+ // errorHeader
+ //
+ this.errorHeader.Text = "Error Message";
+ this.errorHeader.Width = 140;
+ //
+ // openConfigFile
+ //
+ this.openConfigFile.Location = new System.Drawing.Point(211, 179);
+ this.openConfigFile.Name = "openConfigFile";
+ this.openConfigFile.Size = new System.Drawing.Size(179, 23);
+ this.openConfigFile.TabIndex = 12;
+ this.openConfigFile.Text = "Open Config File in External Editor";
+ this.openConfigFile.UseVisualStyleBackColor = true;
+ this.openConfigFile.Visible = false;
+ this.openConfigFile.Click += new System.EventHandler(this.openConfigFile_Click);
+ //
+ // ServerConfigStep1a
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Caption = "Service State";
+ this.Controls.Add(this.openConfigFile);
+ this.Controls.Add(this.errorList);
+ this.Controls.Add(this.restartWarningLabel);
+ this.Controls.Add(this.actionLabel);
+ this.Controls.Add(this.restartWarningIcon);
+ this.Controls.Add(this.skipRestart);
+ this.Controls.Add(this.restartActionLabel);
+ this.Controls.Add(this.restartEmtpyIcon);
+ this.Controls.Add(this.actionFailedIcon);
+ this.Controls.Add(this.restartSuccessIcon);
+ this.Controls.Add(this.actionCurrentIcon);
+ this.Name = "ServerConfigStep1a";
+ this.Controls.SetChildIndex(this.actionCurrentIcon, 0);
+ this.Controls.SetChildIndex(this.restartSuccessIcon, 0);
+ this.Controls.SetChildIndex(this.actionFailedIcon, 0);
+ this.Controls.SetChildIndex(this.restartEmtpyIcon, 0);
+ this.Controls.SetChildIndex(this.restartActionLabel, 0);
+ this.Controls.SetChildIndex(this.skipRestart, 0);
+ this.Controls.SetChildIndex(this.restartWarningIcon, 0);
+ this.Controls.SetChildIndex(this.actionLabel, 0);
+ this.Controls.SetChildIndex(this.restartWarningLabel, 0);
+ this.Controls.SetChildIndex(this.errorList, 0);
+ this.Controls.SetChildIndex(this.openConfigFile, 0);
+ ((System.ComponentModel.ISupportInitialize)(this.restartEmtpyIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.actionCurrentIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.restartSuccessIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.actionFailedIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.restartWarningIcon)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.CheckBox skipRestart;
+ private System.Windows.Forms.PictureBox restartEmtpyIcon;
+ private System.Windows.Forms.Label restartActionLabel;
+ private System.Windows.Forms.PictureBox actionCurrentIcon;
+ private System.Windows.Forms.PictureBox restartSuccessIcon;
+ private System.Windows.Forms.PictureBox actionFailedIcon;
+ private System.Windows.Forms.Label actionLabel;
+ private System.Windows.Forms.PictureBox restartWarningIcon;
+ private System.Windows.Forms.Label restartWarningLabel;
+ private System.Windows.Forms.ListView errorList;
+ private System.Windows.Forms.ColumnHeader errorHeader;
+ private System.Windows.Forms.Button openConfigFile;
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel5.cs'
--- a/StandardPlugins/ServerConfigPanel5.cs 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel5.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,179 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using System.ServiceProcess;
+using System.Diagnostics;
+using System.Text.RegularExpressions;
+using System.IO;
+using WexInstaller.Plugins.Properties;
+
+namespace WexInstaller.Plugins
+{
+ public partial class ServerConfigStep1a : InstallerPanel
+ {
+ private bool nextOk;
+ private bool backOk;
+ private bool executed;
+
+ public ServerConfigStep1a(ServerConfigurationController controller)
+ {
+ InitializeComponent();
+ Controller = controller;
+ nextOk = true;
+ backOk = true;
+ }
+
+ private ServerConfigurationController Controller { get; set; }
+
+ public override void Activate()
+ {
+ if (!executed)
+ {
+ NextButton.Text = Resources.NextButtonExecuteText;
+ NextButton.Refresh();
+ }
+ base.Activate();
+ }
+
+ public override bool NextOk()
+ {
+ return nextOk;
+ }
+
+ public override bool BackOk()
+ {
+ return backOk;
+ }
+
+ public override bool Next()
+ {
+ if (!executed)
+ {
+ NextButton.Text = Resources.NextButtonDefaultText;
+ NextButton.Enabled = false;
+ NextButton.Refresh();
+
+ restartEmtpyIcon.Visible = false;
+ actionFailedIcon.Visible = false;
+ restartWarningIcon.Visible = false;
+ restartWarningLabel.Visible = false;
+ errorList.Visible = false;
+ openConfigFile.Visible = false;
+
+ actionCurrentIcon.Visible = true;
+ actionCurrentIcon.BringToFront();
+ actionCurrentIcon.Refresh();
+
+ // Do work here.
+ DateTime attemptTime = DateTime.Now;
+ Controller.mysql_scm.Start(Controller.ServiceName);
+
+ ServiceControllerStatus sc = Controller.mysql_scm.GetServiceStatus(Controller.ServiceName);
+ if (sc == ServiceControllerStatus.Running)
+ {
+ actionCurrentIcon.Visible = false;
+ restartSuccessIcon.Visible = true;
+ restartSuccessIcon.BringToFront();
+ executed = true;
+ }
+ else
+ {
+ actionCurrentIcon.Visible = false;
+ actionFailedIcon.Visible = true;
+ actionFailedIcon.BringToFront();
+ actionFailedIcon.Refresh();
+
+ TimeSpan searchPeriod = new TimeSpan(0, 0, 60); // 20 Second timeout.
+ errorList.Items.Clear();
+
+ EventLog myEventLog = new EventLog("Application", ".");
+ foreach (EventLogEntry ele in myEventLog.Entries)
+ {
+ if (ele.EntryType == EventLogEntryType.Error &&
+ ele.Source == "MySQL")
+ {
+ if ((ele.TimeWritten - attemptTime) < searchPeriod)
+ {
+ //eventlogs.AppendLine(ele.Message);
+ string eleTitle = String.Format("MySQL Error {0}", ele.Index.ToString());
+
+ ListViewItem item = new ListViewItem(eleTitle);
+ item.Name = Regex.Replace(eleTitle, @" ", "");
+ item.Tag = ele;
+ item.SubItems.Add(String.Empty);
+ errorList.Items.Add(item);
+ }
+ }
+ }
+
+ openConfigFile.Visible = (String.IsNullOrEmpty(Controller.ExistingConfigFile) == false);
+ errorList.Visible = true;
+ restartWarningIcon.Visible = true;
+ restartWarningLabel.Visible = true;
+ errorList.Refresh();
+ restartWarningLabel.Refresh();
+ restartWarningIcon.Refresh();
+
+ NextButton.Text =Resources.NextButtonExecuteText;
+ NextButton.Enabled = true;
+ NextButton.Refresh();
+ }
+
+ return false;
+ }
+ return base.Next();
+ }
+
+ public override bool Back()
+ {
+ if (!executed)
+ {
+ NextButton.Text = Resources.NextButtonDefaultText;
+ NextButton.Refresh();
+ }
+
+ return base.Back();
+ }
+
+
+ private void skipRestart_CheckedChanged(object sender, EventArgs e)
+ {
+ if (skipRestart.Checked == true)
+ {
+ executed = true;
+ NextButton.Text = Resources.NextButtonDefaultText;
+ NextButton.Enabled = true;
+ NextButton.Refresh();
+ }
+ else
+ {
+ executed = false;
+ NextButton.Text = Resources.NextButtonExecuteText;
+ NextButton.Enabled = true;
+ NextButton.Refresh();
+ }
+ }
+
+ private void errorList_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
+ {
+ if (e.IsSelected)
+ {
+ EventLogEntry ele = e.Item.Tag as EventLogEntry;
+ Debug.Assert(ele != null);
+ DialogResult result = MessageBox.Show(String.Format("Error Details? \r\n\r\n {0}", ele.Message), "Error Details", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+
+ private void openConfigFile_Click(object sender, EventArgs e)
+ {
+ if (File.Exists(Controller.ExistingConfigFile))
+ {
+ System.Diagnostics.Process.Start(Controller.ExistingConfigFile);
+ }
+ }
+ }
+}
=== added file 'StandardPlugins/ServerConfigPanel5.resx'
--- a/StandardPlugins/ServerConfigPanel5.resx 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/ServerConfigPanel5.resx 2011-02-07 21:39:05 +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
=== added file 'StandardPlugins/StandardPlugins.csproj'
--- a/StandardPlugins/StandardPlugins.csproj 1970-01-01 00:00:00 +0000
+++ b/StandardPlugins/StandardPlugins.csproj 2011-02-07 21:39:05 +0000
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C471DBDA-2AFA-4EA3-970A-795133F1FE1A}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>WexInstaller.Plugins</RootNamespace>
+ <AssemblyName>StandardPlugins</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mysql.data">
+ <HintPath>..\WexInstaller\mysql.data.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.ServiceProcess" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ConfigurationController.cs" />
+ <Compile Include="IniTemplate.cs" />
+ <Compile Include="MysqlSCM.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="ServerConfigPanel1.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ServerConfigPanel1.Designer.cs">
+ <DependentUpon>ServerConfigPanel1.cs</DependentUpon>
+ </Compile>
+ <Compile Include="ServerConfigPanel2.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ServerConfigPanel2.Designer.cs">
+ <DependentUpon>ServerConfigPanel2.cs</DependentUpon>
+ </Compile>
+ <Compile Include="ServerConfigPanel3.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ServerConfigPanel3.Designer.cs">
+ <DependentUpon>ServerConfigPanel3.cs</DependentUpon>
+ </Compile>
+ <Compile Include="ServerConfigPanel4.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ServerConfigPanel4.Designer.cs">
+ <DependentUpon>ServerConfigPanel4.cs</DependentUpon>
+ </Compile>
+ <Compile Include="ServerConfigPanel5.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ServerConfigPanel5.Designer.cs">
+ <DependentUpon>ServerConfigPanel5.cs</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ServerConfigPanel1.resx">
+ <DependentUpon>ServerConfigPanel1.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ServerConfigPanel2.resx">
+ <DependentUpon>ServerConfigPanel2.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ServerConfigPanel3.resx">
+ <DependentUpon>ServerConfigPanel3.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ServerConfigPanel4.resx">
+ <DependentUpon>ServerConfigPanel4.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ServerConfigPanel5.resx">
+ <DependentUpon>ServerConfigPanel5.cs</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\WexInstaller\WexInstaller.csproj">
+ <Project>{07B31F5A-9F17-4ACF-B3B6-2AF9000B1414}</Project>
+ <Name>WexInstaller</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\server-confirm.JPG" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\ActionOpen.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\server_config_networking.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\ActionCurrent.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\server_config_security.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\ActionDone.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\server_config_windows.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\dev_machine.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\ActionError.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\dedicated_machine.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\ActionWarning.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\server_machine.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\fading_divider.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\warning_sign.png" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>copy $(TargetPath) $(SolutionDir)\WexInstaller\bin\$(ConfigurationName)\$(TargetFileName)
+copy $(TargetDir)\mysql.data.dll $(SolutionDir)\WexInstaller\bin\$(ConfigurationName)\mysql.data.dll</PostBuildEvent>
+ </PropertyGroup>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
=== added file 'WexInstaller/Core/PluginManager.cs'
--- a/WexInstaller/Core/PluginManager.cs 1970-01-01 00:00:00 +0000
+++ b/WexInstaller/Core/PluginManager.cs 2011-02-07 21:39:05 +0000
@@ -0,0 +1,126 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WexInstaller.Core;
+using System.Reflection;
+using System.IO;
+
+namespace WexInstaller.Core
+{
+ class PluginManager
+ {
+ private static PluginManager Instance = new PluginManager();
+ private bool loadedPlugins;
+ private Dictionary<string, ControllerType> controllerTypes =
+ new Dictionary<string, ControllerType>();
+ private Dictionary<string, ProductConfigurationController> controllerCache =
+ new Dictionary<string,ProductConfigurationController>();
+
+ /// <summary>
+ /// Retrieves the latest controller plugin (if any) associated with the given product name
+ /// </summary>
+ /// <param name="productName"></param>
+ /// <returns></returns>
+ public static ProductConfigurationController GetController(string productName)
+ {
+ return Instance.GetControllerInternal(productName);
+ }
+
+ private ProductConfigurationController GetControllerInternal(string productName)
+ {
+ if (!loadedPlugins)
+ LoadPlugins();
+
+ // first look to see if we have created this controller before
+ if (controllerCache.ContainsKey(productName))
+ return controllerCache[productName];
+
+ // now find the best match between the product name and our controller product names
+ string longestKey = String.Empty;
+ foreach (string key in controllerTypes.Keys)
+ if (productName.StartsWith(key) && key.Length > longestKey.Length)
+ longestKey = key;
+ if (!String.IsNullOrEmpty(longestKey))
+ {
+ ControllerType cType = controllerTypes[longestKey];
+ ProductConfigurationController c = (ProductConfigurationController)
+ cType.HostingAssembly.CreateInstance(cType.TypeName, false);
+ if (c != null)
+ {
+ controllerCache[productName] = c;
+ return c;
+ }
+ }
+
+ return null;
+ }
+
+ private void LoadControllersFromAssembly(Assembly assembly)
+ {
+ Type interfaceType = typeof(ProductConfigurationController);
+ Type[] types = assembly.GetTypes();
+
+ Logger.LogInformation(String.Format("Loading controllers from {0}", assembly.Location));
+
+ foreach (Type t in types)
+ {
+ if (!t.IsAbstract && interfaceType.IsAssignableFrom(t))
+ {
+ object[] attr = t.GetCustomAttributes(typeof(ProductConfigurationAttribute), false);
+
+ // if the type doesn't have the right attribute, we ignore it
+ if (attr == null || attr.Length != 1) continue;
+
+ ProductConfigurationAttribute a = (ProductConfigurationAttribute)attr[0];
+
+ // if this is the first controller for this product name, then add it to our
+ // dictionary
+ if (!controllerTypes.ContainsKey(a.ProductName))
+ controllerTypes[a.ProductName] = new ControllerType(assembly, t.FullName, a.Version);
+ else
+ {
+ ControllerType existingType = controllerTypes[a.ProductName];
+ if (a.Version > existingType.Version)
+ controllerTypes[a.ProductName] = new ControllerType(assembly, t.FullName, a.Version);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Loads all the plugins from the executing assembly and all assemblies in the same folder
+ /// that end in -plugin.dll
+ /// </summary>
+ private void LoadPlugins()
+ {
+ if (loadedPlugins) return;
+
+ // first load the plugins that are baked in
+ LoadControllersFromAssembly(Assembly.GetExecutingAssembly());
+
+ string pluginsDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ string[] plugins = Directory.GetFiles(pluginsDir, "*Plugins.dll");
+ foreach (string plugin in plugins)
+ {
+ Assembly a = Assembly.LoadFile(plugin);
+ LoadControllersFromAssembly(a);
+ }
+
+ loadedPlugins = true;
+ }
+ }
+
+ struct ControllerType
+ {
+ public Assembly HostingAssembly;
+ public string TypeName;
+ public int Version;
+
+ public ControllerType(Assembly a, string type, int version)
+ {
+ HostingAssembly = a;
+ TypeName = type;
+ Version = version;
+ }
+ }
+}
=== modified file 'WexInstaller/Core/Product.cs'
--- a/WexInstaller/Core/Product.cs 2011-02-04 16:59:54 +0000
+++ b/WexInstaller/Core/Product.cs 2011-02-07 21:39:05 +0000
@@ -5,7 +5,6 @@
using System.Xml.Serialization;
using System.Collections.ObjectModel;
using WexInstaller.Core;
-using WexInstaller.Panels;
using System.Reflection;
using System.Diagnostics;
using System.Net;
@@ -21,6 +20,7 @@
public class Product : ProductElement
{
+ private bool loadedController;
private ProductConfigurationController controller;
private StringBuilder InstallActionLog;
private WebClient wc;
@@ -38,7 +38,8 @@
{
get
{
- GetController();
+ if (!loadedController)
+ GetController();
return controller;
}
}
@@ -795,38 +796,13 @@
// Configuration Controller.
private void GetController()
{
- if (controller != null) return;
-
- int version = 0;
- Assembly a = Assembly.GetExecutingAssembly();
- GetControllerFromAssembly(a, ref version);
-
- if (controller == null) return;
- controller.Owner = this;
- }
-
- private void GetControllerFromAssembly(Assembly assembly, ref int version)
- {
- Type interfaceType = typeof(ProductConfigurationController);
- Type[] types = assembly.GetTypes();
-
- foreach (Type t in types)
- {
- if (!t.IsAbstract && interfaceType.IsAssignableFrom(t))
- {
- object[] attr = t.GetCustomAttributes(typeof(ProductConfigurationAttribute), false);
- if (attr == null || attr.Length != 1) continue;
- ProductConfigurationAttribute a = (ProductConfigurationAttribute)attr[0];
- if (!Name.Contains(a.ProductName)) continue;
-
- if (a.Version > version)
- {
- controller = (ProductConfigurationController)assembly.CreateInstance(t.FullName);
- version = a.Version;
- }
- }
- }
- }
+ if (loadedController) return;
+ controller = PluginManager.GetController(Name);
+ if (controller != null)
+ controller.Owner = this;
+ loadedController = true;
+ }
+
}
public enum ProductState
=== renamed file 'WexInstaller/Panels/ProductConfigurationController.cs' => 'WexInstaller/Core/ProductConfigurationController.cs'
--- a/WexInstaller/Panels/ProductConfigurationController.cs 2011-02-07 20:46:44 +0000
+++ b/WexInstaller/Core/ProductConfigurationController.cs 2011-02-07 21:39:05 +0000
@@ -5,13 +5,11 @@
using System.Text.RegularExpressions;
using System.Windows.Forms;
using WexInstaller.Core;
-using MySql.Data;
-using MySql.Data.MySqlClient;
using System.ComponentModel;
using System.Threading;
using System.Diagnostics;
-namespace WexInstaller.Panels
+namespace WexInstaller.Core
{
public abstract class ProductConfigurationController
{
@@ -29,6 +27,13 @@
public virtual void Initalize()
{
}
+
+ public event ConfigurationEventHandler Configured;
+ public virtual void OnConfigured(ConfigurationEventArgs args)
+ {
+ if (Configured != null)
+ Configured(this, args);
+ }
}
public class ProductConfigurationAttribute : Attribute
@@ -43,13 +48,6 @@
public int Version { get; set; }
}
- public enum ServerInstallType
- {
- Developer,
- Server,
- Dedicated
- }
-
public enum ConfigurationEventType
{
Info,
@@ -84,454 +82,4 @@
ConfigurationComplete = 3,
ConfigurationError = 4
}
-
- [ProductConfiguration("mysql-server", 1)]
- public class ServerConfigurationController : ProductConfigurationController
- {
- private BackgroundWorker bgw;
- private UserControl[] pages;
- private bool processedTemplate;
- private bool processedService;
- private bool processedSecuritySettings;
-
- public IniTemplate it { get; set; }
- public MySQLServiceControlManager mysql_scm { get; set; }
-
- // UI Controls.
- public ServerInstallType ServerInstallType { get; set; }
- public bool Reconfigure { get; set; }
- public bool EnableTCPIP { get; set; }
- public int Port { get; set; }
- public bool CreateService { get; set; }
- public string ServiceName { get; set; }
- public bool StartAtStartup { get; set; }
- public string RootPassword { get; set; }
- public string ExistingRootPassword { get; set; }
- public string ExistingConfigFile { get; set; }
-
- public ServerConfigurationController()
- {
- CurrentState = ConfigState.ConfigurationRequired;
- Logger.LogInformation("Product configuration controller created.");
- Initalize();
-
- processedTemplate = false;
- processedService = false;
- processedSecuritySettings = false;
- }
-
- public override UserControl[] Pages
- {
- get
- {
- GetPages();
- return pages;
- }
- }
-
- public override int NumPages
- {
- get { return (Reconfigure) ? 1 : 2; }
- }
-
- public override void Configure()
- {
- CurrentState = ConfigState.ConfigurationInProgress;
- Debug.Assert(bgw == null);
- bgw = new BackgroundWorker();
- bgw.WorkerReportsProgress = true;
- bgw.WorkerSupportsCancellation = false;
- bgw.DoWork += new DoWorkEventHandler(bgw_DoConfigure);
- bgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_ConfigureCompleted);
- bgw.ProgressChanged += new ProgressChangedEventHandler(bgw_ConfigureProgressChanged);
- bgw.RunWorkerAsync();
- }
-
- private bool ProcessTemplate()
- {
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "VALID_TEMPLATE"));
- if (it.IsValid)
- {
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "VALID_TEMPLATE"));
-
- switch (ServerInstallType)
- {
- case ServerInstallType.Dedicated:
- it.ServerType = IniServerType.Dedicated;
- break;
- case ServerInstallType.Developer:
- it.ServerType = IniServerType.Developer;
- break;
- case ServerInstallType.Server:
- it.ServerType = IniServerType.Server;
- break;
- }
-
- // Set reasonable defaults.
- it.MyisamUsage = 0.05;
- it.SkipInnodb = false;
- it.DefaultStorageEngine = "INNODB";
- it.DefaultCharacterSet = "utf8";
- it.NumberConnections = 20.0;
- it.UseQueryCache = 0.0;
- it.InnoDBBPSUsage = 0.50;
-
- if (EnableTCPIP)
- {
- it.EnableNetworking = true;
- it.Port = Port.ToString();
- }
-
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "PROCESS_TEMPLATE"));
- it.ProcessTemplate();
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "PROCESS_TEMPLATE"));
- processedTemplate = true;
- }
- else
- {
- // Bad Template. Error.
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "VALID_TEMPLATE"));
-
- processedTemplate = false;
- }
-
- return processedTemplate;
- }
-
- private bool ProcessService()
- {
- try
- {
- string thisServiceName = mysql_scm.FindServiceName(it.BaseDir);
-
- if (thisServiceName.Length > 0)
- //if (it.Reconfiguring)
- {
- // Make sure the existing server uses the new configuration file, then
- // start it.
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
- mysql_scm.Update(thisServiceName,
- String.Format("\"{0}bin\\mysqld\" --defaults-file=\"{1}\" {2}",
- it.BaseDir, it.ConfigurationFile, thisServiceName));
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
-
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
- mysql_scm.Restart(thisServiceName);
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
- }
- else
- {
- // Add and Start the service.
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
- mysql_scm.Add(ServiceName, ServiceName,
- String.Format("\"{0}bin\\mysqld\" --defaults-file=\"{1}\" {2}", it.BaseDir, it.ConfigurationFile, ServiceName));
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
-
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
- mysql_scm.Start(ServiceName);
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
-
- processedService = false;
- }
-
- processedService = true;
- }
- catch
- {
- // Failed to add or start the server
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "CONFIGURE_SERVICE"));
- }
-
- return processedService;
- }
-
- private bool ProcessSecuritySettings()
- {
- try
- {
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "SECURITY_SETTING"));
-
- // Set root password.
- MySqlCommand cmd = new MySqlCommand();
- string connectionString = String.Format("server=localhost;user id=root;port={0};database=mysql;", it.Port);
-
- if (String.IsNullOrEmpty(ExistingRootPassword) == false)
- {
- connectionString += String.Format("password={0}", ExistingRootPassword);
- }
- cmd.Connection = new MySqlConnection(connectionString);
- cmd.Connection.Open();
- cmd.CommandText = String.Format("UPDATE mysql.user SET Password=Password('{0}') WHERE User='root'", RootPassword);
- cmd.ExecuteNonQuery();
- cmd.CommandText = "FLUSH PRIVILEGES";
- cmd.ExecuteNonQuery();
- cmd.Connection.Close();
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "SECURITY_SETTING"));
-
- processedSecuritySettings = true;
- }
- catch (MySqlException)
- {
- // Failed to set root password.
- OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "SECURITY_SETTING"));
- processedSecuritySettings = false;
- }
-
- return processedSecuritySettings;
- }
-
- private void bgw_DoConfigure(object sender, DoWorkEventArgs e)
- {
- if (it == null)
- Initalize();
-
- Logger.LogInformation("Beginning product configuration.");
- if (ProcessTemplate())
- {
- if (this.CreateService == true)
- {
- if (ProcessService())
- {
- ProcessSecuritySettings();
- }
- }
- }
- }
-
- private void bgw_ConfigureProgressChanged(object sender, ProgressChangedEventArgs e)
- {
- if (Configured != null)
- Configured(this, e.UserState as ConfigurationEventArgs);
- }
-
- private void bgw_ConfigureCompleted(object sender, RunWorkerCompletedEventArgs e)
- {
- bgw.Dispose();
- bgw = null;
- if (CurrentState != ConfigState.ConfigurationError)
- CurrentState = ConfigState.ConfigurationComplete;
- if (Configured != null)
- {
- ConfigurationEventArgs ce = new ConfigurationEventArgs(ConfigurationEventType.Finished, "CONFIGURE_COMPLETE");
- ce.PercentComplete = 100;
- ce.Details = "Product configuration controller finished configuration.";
- Configured(this, ce);
- }
- return;
- }
-
- public override void Initalize()
- {
- Logger.LogInformation("Product configuration controller initialization started.");
-
- if (mysql_scm == null)
- mysql_scm = new MySQLServiceControlManager();
-
- string baseDirectory = String.Empty;
- string dataDirectory = String.Empty;
- string foundDataDir = String.Empty;
- string version = String.Empty;
-
- if (Owner != null)
- {
- if (Owner.Installed)
- {
- Logger.LogInformation(String.Format("Product configuration controller found {0} installed.", Owner.Name));
-
- baseDirectory = Owner.GetInstalledProductRegistryKey("Location");
- dataDirectory = Owner.GetInstalledProductRegistryKey("DataLocation");
- foundDataDir = Owner.GetInstalledProductRegistryKey("FoundExistingDataDir");
- version = Owner.GetInstalledProductRegistryKey("Version");
-
- if (!String.IsNullOrEmpty(baseDirectory))
- {
- // Look for existing service.
- this.ServiceName = mysql_scm.FindServiceName(baseDirectory);
- }
-
- if (String.IsNullOrEmpty(this.ServiceName) && !String.IsNullOrEmpty(version))
- {
- // If no existing service, use default.
- this.ServiceName = String.Format("MySQL{0}{1}", version[0], version[2]);
- }
- }
-
- Reconfigure = (Owner.IsUpgrade && Owner.Installed);
- if (Reconfigure)
- {
- Regex defaultsFilePattern = new Regex(@" --defaults-file=""(?<iniLocation>.+)?"" ");
- Match m = defaultsFilePattern.Match(mysql_scm.BinaryPath(ServiceName));
- if (m.Success)
- {
- ExistingConfigFile = Path.GetFullPath(m.Groups["iniLocation"].Value);
- string destination = String.Format("{0}{1}", dataDirectory, Path.GetFileName(ExistingConfigFile));
- try
- {
- File.Copy(ExistingConfigFile, destination);
- }
- catch
- {
- }
- }
- }
- }
-
- if (!String.IsNullOrEmpty(baseDirectory) && !String.IsNullOrEmpty(dataDirectory))
- {
- Logger.LogInformation("Product configuration controller creating new template instance.");
-
- it = new IniTemplate(baseDirectory, dataDirectory, InstallerConfiguration.TemplateName, dataDirectory);
- it.FoundExistingDataDir = (!String.IsNullOrEmpty(foundDataDir) && foundDataDir == "1");
- }
- else
- {
- Logger.LogInformation("Product not currently installed.");
-
- it = null;
- }
- }
-
- private void GetPages()
- {
- if (pages != null) return;
- pages = new UserControl[NumPages];
-
- if (Reconfigure)
- {
- Logger.LogInformation("Setting up product configuration controller for reconfiguration.");
- pages[0]= new ServerConfigStep1a(this);
- }
- else
- {
- Logger.LogInformation("Setting up product configuration controller for new installation.");
- pages[0] = new ServerConfigStep1(this);
- pages[1] = new ServerConfigStep2(this);
- // pages[2] = new ServerConfigStep3(this);
- // pages[3] = new ServerConfigAction(this);
- }
- }
-
- private string GetServerTypeAsString()
- {
- if (ServerInstallType == ServerInstallType.Developer)
- return "Development Machine";
- else if (ServerInstallType == ServerInstallType.Server)
- return "Server Machine";
- else
- return "Dedicated Machine";
- }
-
- public string GetConfigurationAsText()
- {
- StringBuilder s = new StringBuilder();
- s.AppendLine("Configuration Type");
- s.AppendLine(String.Format(" {0}", GetServerTypeAsString()));
- s.AppendLine(String.Format("TCP/IP Networking {0}", EnableTCPIP ? "enabled" : "disabled"));
- s.AppendLine(String.Format(" Port: {0}", EnableTCPIP ? Port.ToString() : "N/A"));
- s.AppendLine("Windows Settings");
- s.AppendLine(String.Format(" Windows Service Name: {0}",
- String.IsNullOrEmpty(ServiceName) ? "<Not Set>" : ServiceName));
- s.AppendLine("Security Settings");
- s.AppendLine(String.Format(" Root Password {0}Set",
- String.IsNullOrEmpty(RootPassword) ? "Not " : ""));
- return s.ToString();
- }
-
- public event ConfigurationEventHandler Configured;
-
- protected virtual void OnConfigured(ConfigurationEventArgs e)
- {
- string message = String.Empty;
- int percent = 100 / 11;
-
- switch (e.Type)
- {
- case (ConfigurationEventType.Info):
- switch (e.Action)
- {
- case "VALID_TEMPLATE":
- message = "Looking for valid template.";
- percent *= 1;
- break;
- case "PROCESS_TEMPLATE":
- percent *= 3;
- message = "Attempting to process template.";
- break;
- case "CONFIGURE_SERVICE":
- percent *= 5;
- message = "Attempting to configure service.";
- break;
- case "START_SERVICE":
- percent *= 7;
- message = "Attempting to start service.";
- break;
- case "SECURITY_SETTING":
- percent *= 9;
- message = "Attempting to update security settings.";
- break;
- }
- Logger.LogInformation(message);
- break;
- case (ConfigurationEventType.Success):
- switch (e.Action)
- {
- case "VALID_TEMPLATE":
- percent *= 2;
- message = "Found valid template.";
- break;
- case "PROCESS_TEMPLATE":
- percent *= 4;
- message = "Processed template.";
- break;
- case "CONFIGURE_SERVICE":
- percent *= 6;
- message = "Configured service.";
- break;
- case "START_SERVICE":
- percent *= 8;
- message = "Started service.";
- break;
- case "SECURITY_SETTING":
- percent *= 10;
- message = "Updated security settings.";
- break;
- }
- Logger.LogInformation(message);
- break;
- case (ConfigurationEventType.Error):
- switch (e.Action)
- {
- case "VALID_TEMPLATE":
- message = "Unable to find a valid template.";
- break;
- case "PROCESS_TEMPLATE":
- message = "Failed to process template.";
- break;
- case "CONFIGURE_SERVICE":
- message = "Unable to configure service.";
- break;
- case "START_SERVICE":
- message = "Failed to start service.";
- break;
- case "SECURITY_SETTING":
- message = "Unable to update security settings.";
- break;
- }
- percent *= 11;
- CurrentState = ConfigState.ConfigurationError;
- Logger.LogError(message);
- break;
- case (ConfigurationEventType.Finished):
- message = "Product configuration controller finished configuration.";
- percent *= 11;
- CurrentState = ConfigState.ConfigurationComplete;
- Logger.LogInformation(message);
- break;
- };
- e.Details = message;
- e.PercentComplete = percent;
-
- bgw.ReportProgress(percent, e);
- }
- }
}
=== modified file 'WexInstaller/Core/ProductManager.cs'
--- a/WexInstaller/Core/ProductManager.cs 2011-02-01 21:05:32 +0000
+++ b/WexInstaller/Core/ProductManager.cs 2011-02-07 21:39:05 +0000
@@ -71,6 +71,9 @@
{
p.PostInitialize(true);
p.SetParent(pc);
+
+ // preload the controller if there are any
+ object o = p.Controller;
}
}
=== modified file 'WexInstaller/InstallWizard/AllConfigOverview.cs'
--- a/WexInstaller/InstallWizard/AllConfigOverview.cs 2011-02-07 20:46:44 +0000
+++ b/WexInstaller/InstallWizard/AllConfigOverview.cs 2011-02-07 21:39:05 +0000
@@ -2,13 +2,10 @@
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.Controls;
-using WexInstaller.Panels;
using WexInstaller.Properties;
namespace WexInstaller
@@ -80,7 +77,7 @@
productList.ProgressBar.Value = 0;
(configuringItem.Tag as Product).Controller.Initalize();
- ((configuringItem.Tag as Product).Controller as ServerConfigurationController).Configured += new ConfigurationEventHandler(ConfigurationChanged);
+ (configuringItem.Tag as Product).Controller.Configured += new ConfigurationEventHandler(ConfigurationChanged);
(configuringItem.Tag as Product).Controller.Configure();
Application.DoEvents();
}
@@ -111,8 +108,6 @@
return textStatus;
}
- private ServerConfigurationController Controller { get; set; }
-
private void ConfigurationChanged(object sender, ConfigurationEventArgs e)
{
if (configuringItem != null)
=== modified file 'WexInstaller/InstallWizard/DetailedUpdateCheck.Designer.cs'
--- a/WexInstaller/InstallWizard/DetailedUpdateCheck.Designer.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/InstallWizard/DetailedUpdateCheck.Designer.cs 2011-02-07 21:39:05 +0000
@@ -1,4 +1,5 @@
-namespace WexInstaller
+ler
{
partial class UpgradeCheck
{
@@ -116,7 +117,7 @@
//
// connectionEmptyIcon
//
- this.connectionEmptyIcon.Image = global::WexInstaller.Properties.Resources.ActionOpen;
+ this.connectionEmptyIcon.Image = Resources.ActionOpen;
this.connectionEmptyIcon.Location = new System.Drawing.Point(80, 154);
this.connectionEmptyIcon.Name = "connectionEmptyIcon";
this.connectionEmptyIcon.Size = new System.Drawing.Size(12, 14);
=== modified file 'WexInstaller/InstallWizard/UpdateCheck.Designer.cs'
--- a/WexInstaller/InstallWizard/UpdateCheck.Designer.cs 2010-09-24 15:32:17 +0000
+++ b/WexInstaller/InstallWizard/UpdateCheck.Designer.cs 2011-02-07 21:39:05 +0000
@@ -1,4 +1,5 @@
-namespace WexInstaller
+using WexInstaller.Properties;
+namespace WexInstaller
{
partial class UpdateCheck
{
@@ -115,7 +116,7 @@
//
// connectionEmptyIcon
//
- this.connectionEmptyIcon.Image = global::WexInstaller.Properties.Resources.ActionOpen;
+ this.connectionEmptyIcon.Image = Resources.ActionOpen;
this.connectionEmptyIcon.Location = new System.Drawing.Point(80, 154);
this.connectionEmptyIcon.Name = "connectionEmptyIcon";
this.connectionEmptyIcon.Size = new System.Drawing.Size(12, 14);
=== modified file 'WexInstaller/InstallerConfiguration.cs'
--- a/WexInstaller/InstallerConfiguration.cs 2011-01-24 15:28:26 +0000
+++ b/WexInstaller/InstallerConfiguration.cs 2011-02-07 21:39:05 +0000
@@ -11,7 +11,7 @@
namespace WexInstaller
{
- internal class InstallerConfiguration
+ public sealed class InstallerConfiguration
{
private static InstallerConfigurationData Instance = new InstallerConfigurationData();
private static WebClient Wc = new WebClient();
=== modified file 'WexInstaller/Properties/Resources.resx'
--- a/WexInstaller/Properties/Resources.resx 2011-01-24 17:24:16 +0000
+++ b/WexInstaller/Properties/Resources.resx 2011-02-07 21:39:05 +0000
@@ -255,9 +255,6 @@
<data name="fading_divider" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\fading_divider.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="server_confirm" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\Resources\server-confirm.JPG;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
- </data>
<data name="mysql_installer" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\mysql-installer.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -333,9 +330,6 @@
<data name="ActionItemResources" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ActionItemResources.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="ActionOpen" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\Resources\ActionOpen.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
- </data>
<data name="ActionWarning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ActionWarning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -387,4 +381,10 @@
<data name="UpdateCaption" xml:space="preserve">
<value>Update?</value>
</data>
+ <data name="ActionOpen" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ActionOpen1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="server_confirm" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\server-confirm1.JPG;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
</root>
\ No newline at end of file
=== modified file 'WexInstaller/WexInstaller.csproj'
--- a/WexInstaller/WexInstaller.csproj 2011-01-31 05:03:43 +0000
+++ b/WexInstaller/WexInstaller.csproj 2011-02-07 21:39:05 +0000
@@ -61,15 +61,9 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
- <Reference Include="mysql.data">
- <HintPath>.\mysql.data.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework" />
<Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
- <Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
@@ -122,10 +116,8 @@
<Compile Include="Core\LoggerListener.cs" />
<Compile Include="Core\MirrorsXML.cs" />
<Compile Include="Core\MsiInterop.cs" />
- <Compile Include="Core\MysqlSCM.cs">
- <SubType>Component</SubType>
- </Compile>
<Compile Include="Core\Package.cs" />
+ <Compile Include="Core\PluginManager.cs" />
<Compile Include="Core\ProductCatalog.cs" />
<Compile Include="Core\ProductCategory.cs" />
<Compile Include="Core\ProductFeature.cs" />
@@ -136,7 +128,6 @@
<Compile Include="HiddenTabsControl.Designer.cs">
<DependentUpon>HiddenTabsControl.cs</DependentUpon>
</Compile>
- <Compile Include="Core\IniTemplate.cs" />
<Compile Include="InstallerConfiguration.cs" />
<Compile Include="Core\Options.cs" />
<Compile Include="Controls\InstallWizardControl.cs">
@@ -219,37 +210,7 @@
<Compile Include="Panels\InstallerPanel.Designer.cs">
<DependentUpon>InstallerPanel.cs</DependentUpon>
</Compile>
- <Compile Include="Panels\ProductConfigurationController.cs" />
- <Compile Include="Panels\ServerConfigPanel4.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel4.Designer.cs">
- <DependentUpon>ServerConfigPanel4.cs</DependentUpon>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel1.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel1.Designer.cs">
- <DependentUpon>ServerConfigPanel1.cs</DependentUpon>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel2.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel2.Designer.cs">
- <DependentUpon>ServerConfigPanel2.cs</DependentUpon>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel3.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel3.Designer.cs">
- <DependentUpon>ServerConfigPanel3.cs</DependentUpon>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel5.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="Panels\ServerConfigPanel5.Designer.cs">
- <DependentUpon>ServerConfigPanel5.cs</DependentUpon>
- </Compile>
+ <Compile Include="Core\ProductConfigurationController.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Controls\RemoveAllPage.cs">
@@ -282,16 +243,6 @@
<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" />
- <Compile Include="UnitTests\MysqlSCMTest.cs" />
- <Compile Include="UnitTests\SimpleProgressBar.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="UnitTests\SimpleProgressBar.Designer.cs">
- <DependentUpon>SimpleProgressBar.cs</DependentUpon>
- </Compile>
<EmbeddedResource Include="Controls\AboutPage.resx">
<DependentUpon>AboutPage.cs</DependentUpon>
</EmbeddedResource>
@@ -349,21 +300,6 @@
<EmbeddedResource Include="Panels\InstallerPanel.resx">
<DependentUpon>InstallerPanel.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Panels\ServerConfigPanel1.resx">
- <DependentUpon>ServerConfigPanel1.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Panels\ServerConfigPanel2.resx">
- <DependentUpon>ServerConfigPanel2.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Panels\ServerConfigPanel3.resx">
- <DependentUpon>ServerConfigPanel3.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Panels\ServerConfigPanel4.resx">
- <DependentUpon>ServerConfigPanel4.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Panels\ServerConfigPanel5.resx">
- <DependentUpon>ServerConfigPanel5.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -389,9 +325,6 @@
<EmbeddedResource Include="RemovePanels\RemoveProgress.resx">
<DependentUpon>RemoveProgress.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="UnitTests\SimpleProgressBar.resx">
- <DependentUpon>SimpleProgressBar.cs</DependentUpon>
- </EmbeddedResource>
<None Include="app.config" />
<None Include="app.manifest" />
<None Include="ClassDiagram1.cd" />
@@ -461,6 +394,7 @@
<None Include="Resources\ActionItemRemove.png" />
<None Include="Resources\ActionItemResources.png" />
<None Include="Resources\ActionOpen.png" />
+ <None Include="Resources\ActionOpen1.png" />
<Content Include="Resources\h_divider.png" />
<Content Include="Resources\linkpanel_divider.png" />
<Content Include="Resources\link_arrow.png" />
@@ -478,6 +412,7 @@
<None Include="Resources\server_config_windows.png" />
<None Include="Resources\server-confirm.JPG" />
<None Include="Resources\plus_sign.png" />
+ <None Include="Resources\server-confirm1.JPG" />
<Content Include="Resources\SidebarBackground.png" />
<None Include="Resources\warning_sign.png" />
<Content Include="Resources\WelcomeBackground.png" />
=== modified file 'installer-vs2010.sln'
--- a/installer-vs2010.sln 2011-02-01 17:53:34 +0000
+++ b/installer-vs2010.sln 2011-02-07 21:39:05 +0000
@@ -18,6 +18,8 @@
{A54EF986-DFDA-45BD-A901-C908C846A02B} = {A54EF986-DFDA-45BD-A901-C908C846A02B}
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StandardPlugins", "StandardPlugins\StandardPlugins.csproj", "{C471DBDA-2AFA-4EA3-970A-795133F1FE1A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -95,6 +97,18 @@
{FBC6C598-EC89-49E6-8FE4-4140141761CC}.Release|Win32.ActiveCfg = Release|x86
{FBC6C598-EC89-49E6-8FE4-4140141761CC}.Release|x86.ActiveCfg = Release|x86
{FBC6C598-EC89-49E6-8FE4-4140141761CC}.Release|x86.Build.0 = Release|x86
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Release|Win32.ActiveCfg = Release|Any CPU
+ {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110207213905-7txs83rz23mpd95f.bundle
| Thread |
|---|
| • bzr commit into wex-installer-1.0 branch (reggie.burnett:306) | Reggie Burnett | 7 Feb |