public static DialogResult Update(object obj) { Hashtable args = Utils.GetSetupParameters(obj); var setupVariables = new SetupVariables { ComponentId = Utils.GetStringSetupParameter(args, Global.Parameters.ComponentId), SetupAction = SetupActions.Update, IISVersion = Global.IISVersion }; AppConfig.LoadConfiguration(); InstallerForm form = new InstallerForm(); Wizard wizard = form.Wizard; wizard.SetupVariables = setupVariables; // AppConfig.LoadComponentSettings(wizard.SetupVariables); IntroductionPage introPage = new IntroductionPage(); LicenseAgreementPage licPage = new LicenseAgreementPage(); ExpressInstallPage page2 = new ExpressInstallPage(); //create install currentScenario InstallAction action = new InstallAction(ActionTypes.Backup); action.Description = "Backing up..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.DeleteFiles); action.Description = "Deleting files..."; action.Path = "setup\\delete.txt"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.CopyFiles); action.Description = "Copying files..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.ExecuteSql); action.Description = "Updating database..."; action.Path = "setup\\update_db.sql"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.UpdateConfig); action.Description = "Updating system configuration..."; page2.Actions.Add(action); FinishPage page3 = new FinishPage(); wizard.Controls.AddRange(new Control[] { introPage, licPage, page2, page3 }); wizard.LinkPages(); wizard.SelectedPage = introPage; //show wizard Form parentForm = args[Global.Parameters.ParentForm] as Form; return(form.ShowDialog(parentForm)); }
public static DialogResult Update(object obj) { Hashtable args = Utils.GetSetupParameters(obj); var setupVariables = new SetupVariables { ComponentId = Utils.GetStringSetupParameter(args, Global.Parameters.ComponentId), SetupAction = SetupActions.Update, IISVersion = Global.IISVersion }; AppConfig.LoadConfiguration(); InstallerForm form = new InstallerForm(); Wizard wizard = form.Wizard; wizard.SetupVariables = setupVariables; // AppConfig.LoadComponentSettings(wizard.SetupVariables); IntroductionPage introPage = new IntroductionPage(); LicenseAgreementPage licPage = new LicenseAgreementPage(); ExpressInstallPage page2 = new ExpressInstallPage(); //create install currentScenario InstallAction action = new InstallAction(ActionTypes.Backup); action.Description = "Backing up..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.DeleteFiles); action.Description = "Deleting files..."; action.Path = "setup\\delete.txt"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.CopyFiles); action.Description = "Copying files..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.ExecuteSql); action.Description = "Updating database..."; action.Path = "setup\\update_db.sql"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.UpdateConfig); action.Description = "Updating system configuration..."; page2.Actions.Add(action); FinishPage page3 = new FinishPage(); wizard.Controls.AddRange(new Control[] { introPage, licPage, page2, page3 }); wizard.LinkPages(); wizard.SelectedPage = introPage; //show wizard Form parentForm = args[Global.Parameters.ParentForm] as Form; return form.ShowDialog(parentForm); }
public static DialogResult Update(object obj) { Hashtable args = Utils.GetSetupParameters(obj); string shellVersion = Utils.GetStringSetupParameter(args, "ShellVersion"); Version version = new Version(shellVersion); if (version < new Version("1.0.1")) { MessageBox.Show("WebsitePanel Installer 1.0.1 or higher required.", "Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(DialogResult.Cancel); } string componentId = Utils.GetStringSetupParameter(args, "ComponentId"); AppConfig.LoadConfiguration(); InstallerForm form = new InstallerForm(); Wizard wizard = form.Wizard; LoadSetupVariablesFromConfig(wizard, componentId); if (wizard.SetupVariables.Version != "1.5.3") { MessageBox.Show("Please update to version 1.5.3", "Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(DialogResult.Cancel); } wizard.SetupVariables.SetupAction = SetupActions.Update; wizard.SetupVariables.BaseDirectory = Utils.GetStringSetupParameter(args, "BaseDirectory"); wizard.SetupVariables.UpdateVersion = Utils.GetStringSetupParameter(args, "UpdateVersion"); wizard.SetupVariables.InstallerFolder = Utils.GetStringSetupParameter(args, "InstallerFolder"); wizard.SetupVariables.Installer = Utils.GetStringSetupParameter(args, "Installer"); wizard.SetupVariables.InstallerType = Utils.GetStringSetupParameter(args, "InstallerType"); wizard.SetupVariables.InstallerPath = Utils.GetStringSetupParameter(args, "InstallerPath"); wizard.SetupVariables.IISVersion = Utils.GetVersionSetupParameter(args, "IISVersion"); IntroductionPage introPage = new IntroductionPage(); LicenseAgreementPage licPage = new LicenseAgreementPage(); ExpressInstallPage page2 = new ExpressInstallPage(); //create install actions InstallAction action = new InstallAction(ActionTypes.Backup); action.Description = "Backing up..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.DeleteFiles); action.Description = "Deleting files..."; action.Path = "setup\\delete.txt"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.CopyFiles); action.Description = "Copying files..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.ExecuteSql); action.Description = "Updating database..."; action.Path = "setup\\update_db.sql"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.UpdateConfig); action.Description = "Updating system configuration..."; page2.Actions.Add(action); FinishPage page3 = new FinishPage(); wizard.Controls.AddRange(new Control[] { introPage, licPage, page2, page3 }); wizard.LinkPages(); wizard.SelectedPage = introPage; //show wizard Form parentForm = args["ParentForm"] as Form; return(form.ShowDialog(parentForm)); }
public static DialogResult Update(object obj) { Hashtable args = Utils.GetSetupParameters(obj); string shellVersion = Utils.GetStringSetupParameter(args, "ShellVersion"); Version version = new Version(shellVersion); if (version < new Version("1.0.1")) { MessageBox.Show("WebsitePanel Installer 1.0.1 or higher required.", "Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Warning); return DialogResult.Cancel; } string componentId = Utils.GetStringSetupParameter(args, "ComponentId"); AppConfig.LoadConfiguration(); InstallerForm form = new InstallerForm(); Wizard wizard = form.Wizard; LoadSetupVariablesFromConfig(wizard, componentId); if (wizard.SetupVariables.Version != "1.5.3") { MessageBox.Show("Please update to version 1.5.3", "Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Warning); return DialogResult.Cancel; } wizard.SetupVariables.SetupAction = SetupActions.Update; wizard.SetupVariables.BaseDirectory = Utils.GetStringSetupParameter(args, "BaseDirectory"); wizard.SetupVariables.UpdateVersion = Utils.GetStringSetupParameter(args, "UpdateVersion"); wizard.SetupVariables.InstallerFolder = Utils.GetStringSetupParameter(args, "InstallerFolder"); wizard.SetupVariables.Installer = Utils.GetStringSetupParameter(args, "Installer"); wizard.SetupVariables.InstallerType = Utils.GetStringSetupParameter(args, "InstallerType"); wizard.SetupVariables.InstallerPath = Utils.GetStringSetupParameter(args, "InstallerPath"); wizard.SetupVariables.IISVersion = Utils.GetVersionSetupParameter(args, "IISVersion"); IntroductionPage introPage = new IntroductionPage(); LicenseAgreementPage licPage = new LicenseAgreementPage(); ExpressInstallPage page2 = new ExpressInstallPage(); //create install actions InstallAction action = new InstallAction(ActionTypes.Backup); action.Description = "Backing up..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.DeleteFiles); action.Description = "Deleting files..."; action.Path = "setup\\delete.txt"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.CopyFiles); action.Description = "Copying files..."; page2.Actions.Add(action); action = new InstallAction(ActionTypes.ExecuteSql); action.Description = "Updating database..."; action.Path = "setup\\update_db.sql"; page2.Actions.Add(action); action = new InstallAction(ActionTypes.UpdateConfig); action.Description = "Updating system configuration..."; page2.Actions.Add(action); FinishPage page3 = new FinishPage(); wizard.Controls.AddRange(new Control[] { introPage, licPage, page2, page3 }); wizard.LinkPages(); wizard.SelectedPage = introPage; //show wizard Form parentForm = args["ParentForm"] as Form; return form.ShowDialog(parentForm); }