/// <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); }
/// <summary> /// EnterPage /// </summary> public override void EnterPage() { // Ok... now we need to hook the action up to the progress bar base.EnterPage(); if (PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.Uninstall)) { this.installationProgressHeader.Text = WpfResources.WPFResourceDictionary.UninstallationProgressText; PrepareInstallData.PrepareInstallDataItems(); SetupFileValidation.ResetInstallItemFileLocations( PropertyBagDictionary.Instance.GetProperty <string>(PropertyBagConstants.LocationOfSetupFiles), PropertyBagDictionary.Instance.GetProperty <string>(PropertyBagConstants.LocationOfSetupFiles)); // Look for missing files if (SetupFileValidation.HaveAllNeededInstallItemFiles()) { SetupHelpers.LogPropertyBag(); // return true; } } else { this.installationProgressHeader.Text = WpfResources.WPFResourceDictionary.InstallationProgressText; } this.LayoutInstallItems(); this.Page.Host.SetNextButtonState(true, false, null); this.backgroundWorkerProcessInstalls.RunWorkerAsync(); }
/// <summary> /// Enters the page. /// </summary> public override void EnterPage() { base.EnterPage(); if (PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.Uninstall)) { this.Page.Host.SetNextButtonState(true, true, WpfResources.WPFResourceDictionary.UninstallButton); } else { this.Page.Host.SetNextButtonState(true, true, WpfResources.WPFResourceDictionary.InstallButton); } if (PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.VhdVersionConfiguration)) { PropertyBagDictionary.Instance.SafeAdd(PropertyBagConstants.Server, "1"); PropertyBagDictionary.Instance.SafeAdd(PropertyBagConstants.CMPServer, "1"); PropertyBagDictionary.Instance.SafeAdd(PropertyBagConstants.TenantExtension, "1"); PropertyBagDictionary.Instance.SafeAdd(PropertyBagConstants.AdminExtension, "1"); } // Setup the data for the items to install PrepareInstallData.PrepareInstallDataItems(); // Load the summary text box if (PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.AddRemoveMode)) { this.installationSummaryHeader.Text = WPFResourceDictionary.AddRemoveComponentTitleText; if (PropertyBagDictionary.Instance.GetProperty <int>(PropertyBagConstants.AddRemoveMode) == (int)CMP.Setup.AddRemovePage.AddRemoveProgramFilesModes.Add) { this.installationSummaryDescription.Text = WPFResourceDictionary.InstallSummaryText; } else { this.installationSummaryDescription.Text = WPFResourceDictionary.RemoveFeatureSummaryText; } } else { this.installationSummaryHeader.Text = WPFResourceDictionary.InstallTitleText; this.installationSummaryDescription.Text = WPFResourceDictionary.InstallSummaryText; } this.PopulateInstallationSummary(); }