Beispiel #1
0
 private void ClearWizardActionsInUIContext(object state)
 {
     if (WizardActions != null)
     {
         WizardActions.Clear();
     }
 }
Beispiel #2
0
        private void AddWizardAction(object obj)
        {
            WizardAction action = obj as WizardAction;

            if (action != null)
            {
                WizardActions.Add(action);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Wizard page change logic
        /// </summary>
        private void NextPage()
        {
            // Only support oml installed databses at the moment
            (WizStart as Wiz_Start).cbAdvanced.Visible = false;

            if (CurrentPage == null)
            {
                if (OMLEngine.DatabaseManagement.DatabaseInformation.ConfigFileExists)
                {
                    OMLEngine.Utilities.DebugLine("[PostInstallerWizard] settings.xml file exists, assume SQL is allready setup");

                    // Good news, this must be an upgrade. Just need to check
                    // we can connect and check the schema version
                    (WizStart as Wiz_Start).lMessage1.Text = "This wizard has detected an existing installation of OML!";
                    (WizStart as Wiz_Start).lMessage2.Text = "Press Next to begin checking the database.";

                    sapassword   = OMLEngine.DatabaseManagement.DatabaseInformation.SAPassword;
                    instancename = OMLEngine.DatabaseManagement.DatabaseInformation.SQLInstanceName;
                    servername   = OMLEngine.DatabaseManagement.DatabaseInformation.SQLServerName;

                    WizardAction = WizardActions.CheckAndUpgradeSchema;
                }
                else
                {
                    OMLEngine.Utilities.DebugLine("[PostInstallerWizard] settings.xml does not exist, install SQL");
                    // This must be a new install. Is it a server install
                    if (ServerInstall)
                    {
                        // Server installation
                        if (ServerAllreadyInstalled)
                        {
                            (WizStart as Wiz_Start).cbAdvanced.Visible = false;
                            (WizStart as Wiz_Start).lMessage1.Text     = "This wizard has detected a previous installation of OML!";
                            (WizStart as Wiz_Start).lMessage2.Text     = "Press Next to begin checking the database.";
                            WizardAction = WizardActions.CheckAndUpgradeSchema;
                        }
                        else
                        {
                            (WizStart as Wiz_Start).lMessage1.Text = "This wizard will install and prepare SQL Server for OML!";
                            (WizStart as Wiz_Start).lMessage2.Text = "Press Next to begin installing SQL Server.";
                            WizardAction = WizardActions.InstallSQLServer;
                        }
                    }
                    else
                    {
                        // Client installation
                        (WizStart as Wiz_Start).lMessage1.Text = "This wizard will assist in setting up OML for a remote server!";
                        (WizStart as Wiz_Start).lMessage2.Text = "Press Next to select a server.";
                        WizardAction = WizardActions.SetupForRemoteServer;
                    }
                }
                SetWizardPage(WizStart);
                return;
            }


            if (CurrentPage == WizStart)
            {
                AdvancedMode = (WizStart as Wiz_Start).cbAdvanced.Checked;

                if (WizardAction == WizardActions.CheckAndUpgradeSchema)
                {
                    // Check & Upgrade Schema
                    CheckAndUpgradeSchema();
                    buttonNext.Text    = "Finish";
                    buttonBack.Enabled = false;
                    SetWizardPage(WizEnd);
                }
                if (WizardAction == WizardActions.InstallSQLServer)
                {
                    // Install SQL
                    if (AdvancedMode == true)
                    {
                        if (InstallNewInstance)
                        {
                            (WizSelectServer as Wiz_SelectServer).rbInstall.Checked             = true;
                            (WizSelectServer as Wiz_SelectServer).rbUseExistingInstance.Checked = false;
                        }
                        else
                        {
                            (WizSelectServer as Wiz_SelectServer).rbInstall.Checked             = false;
                            (WizSelectServer as Wiz_SelectServer).rbUseExistingInstance.Checked = true;
                        }

                        SetWizardPage(WizSelectServer);
                    }
                    else
                    {
                        if (RunSQLSetup())
                        {
                            WriteSettings();
                            ConfigureSQL();
                            SetWizardPage(WizEnd);
                        }
                        else
                        {
                            SetWizardPage(WizEndSQLInstallFail);
                        }
                    }
                }
                if (WizardAction == WizardActions.SetupForRemoteServer)
                {
                    ShowSelectExistingServerPage(AdvancedMode);
                }
                return;
            }

            if (CurrentPage == WizSelectServer)
            {
                if ((WizSelectServer as Wiz_SelectServer).rbInstall.Checked == true)
                {
                    WriteSettings();
                    RunSQLSetup();
                    ConfigureSQL();
                    buttonNext.Text    = "Finish";
                    buttonBack.Enabled = false;
                    SetWizardPage(WizEnd);
                }
                else
                {
                    ShowSelectExistingServerPage(true);
                    InstallNewInstance = false;
                }
                return;
            }


            if (CurrentPage == WizSelectExistingServer)
            {
                servername = (WizSelectExistingServer as Wiz_SelectExistingServer).cbServers.Text;
                if (AdvancedMode)
                {
                    sapassword   = (WizSelectExistingServer as Wiz_SelectExistingServer).teSAPwd.Text;
                    instancename = (WizSelectExistingServer as Wiz_SelectExistingServer).teInstance.Text;
                }

                // Check & Upgrade Schema
                CheckAndUpgradeSchema();
                SetWizardPage(WizEnd);
                return;
            }


            if (CurrentPage == WizEnd)
            {
                WriteSettings();
                this.Close();
            }

            if (CurrentPage == WizEndSQLInstallFail)
            {
                this.Close();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Wizard page change logic
        /// </summary>
        private void NextPage()
        {
            // Only support oml installed databses at the moment
            (WizStart as Wiz_Start).cbAdvanced.Visible = false;

            if (CurrentPage == null)
            {
                if (OMLEngine.DatabaseManagement.DatabaseInformation.ConfigFileExists)
                {
                    OMLEngine.Utilities.DebugLine("[PostInstallerWizard] settings.xml file exists, assume SQL is allready setup");

                    // Good news, this must be an upgrade. Just need to check
                    // we can connect and check the schema version
                    (WizStart as Wiz_Start).lMessage1.Text = "This wizard has detected an existing installation of OML!";
                    (WizStart as Wiz_Start).lMessage2.Text = "Press Next to begin checking the database.";

                    sapassword = OMLEngine.DatabaseManagement.DatabaseInformation.SAPassword;
                    instancename = OMLEngine.DatabaseManagement.DatabaseInformation.SQLInstanceName;
                    servername = OMLEngine.DatabaseManagement.DatabaseInformation.SQLServerName;

                    WizardAction = WizardActions.CheckAndUpgradeSchema;
                }
                else
                {
                    OMLEngine.Utilities.DebugLine("[PostInstallerWizard] settings.xml does not exist, install SQL");
                    // This must be a new install. Is it a server install
                    if (ServerInstall)
                    {
                        // Server installation
                        if (ServerAllreadyInstalled)
                        {
                            (WizStart as Wiz_Start).cbAdvanced.Visible = false;
                            (WizStart as Wiz_Start).lMessage1.Text = "This wizard has detected a previous installation of OML!";
                            (WizStart as Wiz_Start).lMessage2.Text = "Press Next to begin checking the database.";
                            WizardAction = WizardActions.CheckAndUpgradeSchema;
                        }
                        else
                        {
                            (WizStart as Wiz_Start).lMessage1.Text = "This wizard will install and prepare SQL Server for OML!";
                            (WizStart as Wiz_Start).lMessage2.Text = "Press Next to begin installing SQL Server.";
                            WizardAction = WizardActions.InstallSQLServer;
                        }
                    }
                    else
                    {
                        // Client installation
                        (WizStart as Wiz_Start).lMessage1.Text = "This wizard will assist in setting up OML for a remote server!";
                        (WizStart as Wiz_Start).lMessage2.Text = "Press Next to select a server.";
                        WizardAction = WizardActions.SetupForRemoteServer;
                    }
                }
                SetWizardPage(WizStart);
                return;
            }

            if (CurrentPage == WizStart)
            {
                AdvancedMode = (WizStart as Wiz_Start).cbAdvanced.Checked;

                if (WizardAction == WizardActions.CheckAndUpgradeSchema)
                {
                    // Check & Upgrade Schema
                    CheckAndUpgradeSchema();
                    buttonNext.Text = "Finish";
                    buttonBack.Enabled = false;
                    SetWizardPage(WizEnd);
                }
                if (WizardAction == WizardActions.InstallSQLServer)
                {
                    // Install SQL
                    if (AdvancedMode == true)
                    {
                        if (InstallNewInstance)
                        {
                            (WizSelectServer as Wiz_SelectServer).rbInstall.Checked = true;
                            (WizSelectServer as Wiz_SelectServer).rbUseExistingInstance.Checked = false;
                        }
                        else
                        {
                            (WizSelectServer as Wiz_SelectServer).rbInstall.Checked = false;
                            (WizSelectServer as Wiz_SelectServer).rbUseExistingInstance.Checked = true;
                        }

                        SetWizardPage(WizSelectServer);
                    }
                    else
                    {
                        if (RunSQLSetup())
                        {
                            WriteSettings();
                            ConfigureSQL();
                            SetWizardPage(WizEnd);
                        }
                        else
                        {
                            SetWizardPage(WizEndSQLInstallFail);
                        }
                    }
                }
                if (WizardAction == WizardActions.SetupForRemoteServer)
                {
                    ShowSelectExistingServerPage(AdvancedMode);
                }
                return;
            }

            if (CurrentPage == WizSelectServer)
            {
                if ((WizSelectServer as Wiz_SelectServer).rbInstall.Checked == true)
                {
                    WriteSettings();
                    RunSQLSetup();
                    ConfigureSQL();
                    buttonNext.Text = "Finish";
                    buttonBack.Enabled = false;
                    SetWizardPage(WizEnd);
                }
                else
                {
                    ShowSelectExistingServerPage(true);
                    InstallNewInstance = false;
                }
                return;
            }

            if (CurrentPage == WizSelectExistingServer)
            {
                servername = (WizSelectExistingServer as Wiz_SelectExistingServer).cbServers.Text;
                if (AdvancedMode)
                {
                    sapassword = (WizSelectExistingServer as Wiz_SelectExistingServer).teSAPwd.Text;
                    instancename = (WizSelectExistingServer as Wiz_SelectExistingServer).teInstance.Text;
                }

                // Check & Upgrade Schema
                CheckAndUpgradeSchema();
                SetWizardPage(WizEnd);
                return;
            }

            if (CurrentPage == WizEnd)
            {
                WriteSettings();
                this.Close();
            }

            if (CurrentPage == WizEndSQLInstallFail)
            {
                this.Close();
            }
        }