Example #1
0
        /// <summary>
        /// Launch Setup in Silent Mode
        /// </summary>
        /// <returns>a SetupReturnValues reflecting success or possible failure causes</returns>
        private static SetupReturnValues SilentRun()
        {
            // Setup the data for the items to install
            PrepareInstallData.PrepareInstallDataItems();

            // Check to see that we have all the install files we need.
            // Make sure the file locations are set for the install files.
            SetupFileValidation.ResetInstallItemFileLocations(
                PropertyBagDictionary.Instance.GetProperty <string>(PropertyBagConstants.LocationOfSetupFiles),
                PropertyBagDictionary.Instance.GetProperty <string>(PropertyBagConstants.LocationOfSetupFiles));

            if (!PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.Uninstall))
            {
                if (!SetupFileValidation.HaveAllNeededInstallItemFiles())
                {
                    return(SetupReturnValues.InvalidInstallImage);
                }

                SetupHelpers.SetFeatureSwitches();
                // If we are not uninstalling, Do the prereq check
                if (2 == SetupHelpers.DoAllPrerequisiteChecks())
                {
                    // We failed prereq tests so we will fail the install
                    SetupLogger.LogError("We failed the prerequisite checks.");
                    return(SetupReturnValues.FailedPrerequisiteChecks);
                }

                // If this is a server installation,
                // - check if there is an existing database,
                // and if so, check if upgrade is supported from that version
                // - make sure client is also installed with server.
                if (PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.Server))
                {
                    // Error conditions
                    // An unsupported database found
                    // A supported database is found, but user didnt explicitly specify upgrade

                    // CheckDatabase will throw an exception if DB version is
                    // incompatible
                    string sqlMachineName = (String)SetupInputs.Instance.FindItem(SetupInputTags.SqlMachineNameTag);

                    String fullInstanceName = SetupDatabaseHelper.ConstructFullInstanceName(
                        !SetupDatabaseHelper.SqlServerIsOnLocalComputer(sqlMachineName),
                        sqlMachineName,
                        (String)SetupInputs.Instance.FindItem(SetupInputTags.SqlInstanceNameTag),
                        (int)SetupInputs.Instance.FindItem(SetupInputTags.SqlServerPortTag));
                }
            }

            // Do the install using the passed information
            InstallActionProcessor installs = new InstallActionProcessor();

            SetupLogger.LogInfo("Silent ProcessInstalls Starting");

            SetupReturnValues rturn = installs.ProcessInstalls();

            SetupLogger.LogInfo("Silent ProcessInstalls Done");

            return(rturn);
        }
Example #2
0
        /// <summary>
        /// OnProcessInstallDoWork
        /// </summary>
        /// <param name="sender">object</param>
        /// <param name="e">DoWorkEventArgs</param>
        private void OnProcessInstallDoWork(object sender, DoWorkEventArgs e)
        {
            InstallActionProcessor installs = new InstallActionProcessor();

            System.Diagnostics.Debug.WriteLine("ProcessInstalls Starting");

            installs.ProcessInstalls();

            System.Diagnostics.Debug.WriteLine("ProcessInstalls Done");
        }