From ef97dcfd38e9a04bd4998205361bcd459c2b5a6f Mon Sep 17 00:00:00 2001 From: McMak Date: Tue, 5 May 2015 09:25:45 +0300 Subject: [PATCH] Fix config checks. --- .../WebsitePanel.Setup/EnterpriseServer.cs | 6 +- .../Sources/WebsitePanel.Setup/Portal.cs | 6 +- .../Sources/WebsitePanel.Setup/Server.cs | 188 +++++++++--------- .../StandaloneServerSetup.cs | 6 +- 4 files changed, 103 insertions(+), 103 deletions(-) diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/EnterpriseServer.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/EnterpriseServer.cs index d854ed4e..8669b146 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/EnterpriseServer.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/EnterpriseServer.cs @@ -138,9 +138,9 @@ namespace WebsitePanel.Setup var licPage = new LicenseAgreementPage(); var page1 = new ConfigurationCheckPage(); // - ConfigurationCheck check1 = new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement"); - ConfigurationCheck check2 = new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement"); - ConfigurationCheck check3 = new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement"); + ConfigurationCheck check1 = new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement") { SetupVariables = setupVariables }; + ConfigurationCheck check2 = new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement") { SetupVariables = setupVariables }; + ConfigurationCheck check3 = new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement") { SetupVariables = setupVariables }; // page1.Checks.AddRange(new ConfigurationCheck[] { check1, check2, check3 }); // diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Portal.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Portal.cs index ab0b7937..b187e88a 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Portal.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Portal.cs @@ -124,9 +124,9 @@ namespace WebsitePanel.Setup var introPage = new IntroductionPage(); var licPage = new LicenseAgreementPage(); var page1 = new ConfigurationCheckPage(); - ConfigurationCheck check1 = new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement"); - ConfigurationCheck check2 = new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement"); - ConfigurationCheck check3 = new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement"); + ConfigurationCheck check1 = new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement") { SetupVariables = setupVariables }; + ConfigurationCheck check2 = new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement") { SetupVariables = setupVariables }; + ConfigurationCheck check3 = new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement") { SetupVariables = setupVariables }; page1.Checks.AddRange(new ConfigurationCheck[] { check1, check2, check3 }); var page2 = new InstallFolderPage(); var page3 = new WebPage(); diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Server.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Server.cs index 2a07af17..5a0ddce6 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Server.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Server.cs @@ -44,107 +44,107 @@ namespace WebsitePanel.Setup return InstallBase(obj, "1.0.1"); } - internal static object InstallBase(object obj, string minimalInstallerVersion) - { - Hashtable args = Utils.GetSetupParameters(obj); + internal static object InstallBase(object obj, string minimalInstallerVersion) + { + Hashtable args = Utils.GetSetupParameters(obj); - //check CS version - string shellVersion = Utils.GetStringSetupParameter(args, Global.Parameters.ShellVersion); - var shellMode = Utils.GetStringSetupParameter(args, Global.Parameters.ShellMode); - Version version = new Version(shellVersion); - // - var setupVariables = new SetupVariables - { - SetupAction = SetupActions.Install, - IISVersion = Global.IISVersion - }; - // - InitInstall(args, setupVariables); - //Unattended setup - LoadSetupVariablesFromSetupXml(setupVariables.SetupXml, setupVariables); - // - var sam = new ServerActionManager(setupVariables); - // Prepare installation defaults - sam.PrepareDistributiveDefaults(); - // Silent Installer Mode - if (shellMode.Equals(Global.SilentInstallerShell, StringComparison.OrdinalIgnoreCase)) - { - if (version < new Version(minimalInstallerVersion)) - { - Utils.ShowConsoleErrorMessage(Global.Messages.InstallerVersionIsObsolete, minimalInstallerVersion); - // - return false; - } + //check CS version + string shellVersion = Utils.GetStringSetupParameter(args, Global.Parameters.ShellVersion); + var shellMode = Utils.GetStringSetupParameter(args, Global.Parameters.ShellMode); + Version version = new Version(shellVersion); + // + var setupVariables = new SetupVariables + { + SetupAction = SetupActions.Install, + IISVersion = Global.IISVersion + }; + // + InitInstall(args, setupVariables); + //Unattended setup + LoadSetupVariablesFromSetupXml(setupVariables.SetupXml, setupVariables); + // + var sam = new ServerActionManager(setupVariables); + // Prepare installation defaults + sam.PrepareDistributiveDefaults(); + // Silent Installer Mode + if (shellMode.Equals(Global.SilentInstallerShell, StringComparison.OrdinalIgnoreCase)) + { + if (version < new Version(minimalInstallerVersion)) + { + Utils.ShowConsoleErrorMessage(Global.Messages.InstallerVersionIsObsolete, minimalInstallerVersion); + // + return false; + } - try - { - var success = true; - // - setupVariables.ServerPassword = Utils.GetStringSetupParameter(args, Global.Parameters.ServerPassword); - // - sam.ActionError += new EventHandler((object sender, ActionErrorEventArgs e) => - { - Utils.ShowConsoleErrorMessage(e.ErrorMessage); - // - Log.WriteError(e.ErrorMessage); - // - success = false; - }); - // - sam.Start(); - // - return success; - } - catch (Exception ex) - { - Log.WriteError("Failed to install the component", ex); - // - return false; - } - } - else - { - if (version < new Version(minimalInstallerVersion)) - { - MessageBox.Show(String.Format(Global.Messages.InstallerVersionIsObsolete, minimalInstallerVersion), "Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Warning); - // - return DialogResult.Cancel; - } + try + { + var success = true; + // + setupVariables.ServerPassword = Utils.GetStringSetupParameter(args, Global.Parameters.ServerPassword); + // + sam.ActionError += new EventHandler((object sender, ActionErrorEventArgs e) => + { + Utils.ShowConsoleErrorMessage(e.ErrorMessage); + // + Log.WriteError(e.ErrorMessage); + // + success = false; + }); + // + sam.Start(); + // + return success; + } + catch (Exception ex) + { + Log.WriteError("Failed to install the component", ex); + // + return false; + } + } + else + { + if (version < new Version(minimalInstallerVersion)) + { + MessageBox.Show(String.Format(Global.Messages.InstallerVersionIsObsolete, minimalInstallerVersion), "Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Warning); + // + return DialogResult.Cancel; + } - var form = new InstallerForm(); - var wizard = form.Wizard; - wizard.SetupVariables = setupVariables; - // - wizard.ActionManager = sam; + var form = new InstallerForm(); + var wizard = form.Wizard; + wizard.SetupVariables = setupVariables; + // + wizard.ActionManager = sam; - //create wizard pages - var introPage = new IntroductionPage(); - var licPage = new LicenseAgreementPage(); - // - var page1 = new ConfigurationCheckPage(); - page1.Checks.AddRange(new ConfigurationCheck[] + //create wizard pages + var introPage = new IntroductionPage(); + var licPage = new LicenseAgreementPage(); + // + var page1 = new ConfigurationCheckPage(); + page1.Checks.AddRange(new ConfigurationCheck[] { - new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement"), - new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement"), - new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement") + new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement"){ SetupVariables = setupVariables }, + new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement"){ SetupVariables = setupVariables }, + new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement"){ SetupVariables = setupVariables } }); - // - var page2 = new InstallFolderPage(); - var page3 = new WebPage(); - var page4 = new UserAccountPage(); - var page5 = new ServerPasswordPage(); - var page6 = new ExpressInstallPage2(); - var page7 = new FinishPage(); - // - wizard.Controls.AddRange(new Control[] { introPage, licPage, page1, page2, page3, page4, page5, page6, page7 }); - wizard.LinkPages(); - wizard.SelectedPage = introPage; + // + var page2 = new InstallFolderPage(); + var page3 = new WebPage(); + var page4 = new UserAccountPage(); + var page5 = new ServerPasswordPage(); + var page6 = new ExpressInstallPage2(); + var page7 = new FinishPage(); + // + wizard.Controls.AddRange(new Control[] { introPage, licPage, page1, page2, page3, page4, page5, page6, page7 }); + wizard.LinkPages(); + wizard.SelectedPage = introPage; - //show wizard - IWin32Window owner = args["ParentForm"] as IWin32Window; - return form.ShowModal(owner); - } - } + //show wizard + IWin32Window owner = args["ParentForm"] as IWin32Window; + return form.ShowModal(owner); + } + } public static object Uninstall(object obj) { diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/StandaloneServerSetup.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/StandaloneServerSetup.cs index b9010dad..d6d8162d 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/StandaloneServerSetup.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/StandaloneServerSetup.cs @@ -250,9 +250,9 @@ namespace WebsitePanel.Setup var page2 = new ConfigurationCheckPage(); // Setup prerequisites validation page2.Checks.AddRange(new ConfigurationCheck[] { - new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement"), - new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement"), - new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement"), + new ConfigurationCheck(CheckTypes.OperationSystem, "Operating System Requirement"){ SetupVariables = serverSetup }, + new ConfigurationCheck(CheckTypes.IISVersion, "IIS Requirement"){ SetupVariables = serverSetup }, + new ConfigurationCheck(CheckTypes.ASPNET, "ASP.NET Requirement"){ SetupVariables = serverSetup }, // Validate Server installation prerequisites new ConfigurationCheck(CheckTypes.WPServer, "WebsitePanel Server Requirement") { SetupVariables = serverSetup }, // Validate EnterpriseServer installation prerequisites