Example #1
0
        public InstallerForm()
        {
            this.contentControls = new InstallerControlList();
            this.options         = new InstallOptions();
            InitializeComponent();

            this.Load += new EventHandler(InstallerForm_Load);
        }
        protected internal override void Close(InstallOptions options)
        {
            WebApplicationInfo webAppInfo;

            if (InstallConfiguration.RequireDeploymentToCentralAdminWebApplication)
            {
                foreach (TreeNode webAppTreeNode in siteCollectionsTreeView.Nodes)
                {
                    if (((webAppInfo = webAppTreeNode.Tag as WebApplicationInfo) != null) && (webAppInfo.IsSRP || ((webAppInfo.Application != null) && webAppInfo.Application.IsAdministrationWebApplication)))
                    {
                        webAppTreeNode.Checked = true;
                        foreach (TreeNode tn in webAppTreeNode.Nodes)
                        {
                            tn.Checked = true;
                        }
                    }
                }
            }
            foreach (TreeNode webAppTreeNode in siteCollectionsTreeView.Nodes)
            {
                // Add the web application as a target
                if (webAppTreeNode.Checked && ((webAppInfo = webAppTreeNode.Tag as WebApplicationInfo) != null))
                {
                    options.WebApplicationTargets.Add(webAppInfo.Application);
                    ExtendedTreeNode extendedWebAppTreeNode = webAppTreeNode as ExtendedTreeNode;
                    if (extendedWebAppTreeNode != null)
                    {
                        if (!extendedWebAppTreeNode.Populated)
                        {
                            // Add ALL site collections within the web app as targets
                            foreach (SPSite siteCollection in webAppInfo.Application.Sites)
                            {
                                options.SiteCollectionTargets.Add(siteCollection);
                            }
                        }
                        else
                        {
                            // Add the checked site collections within this web application as targets
                            foreach (TreeNode siteCollTreeNode in webAppTreeNode.Nodes)
                            {
                                if (siteCollTreeNode.Checked)
                                {
                                    SiteCollectionInfo siteCollInfo = siteCollTreeNode.Tag as SiteCollectionInfo;
                                    if (siteCollInfo != null)
                                    {
                                        options.SiteCollectionTargets.Add(siteCollInfo.SiteCollection);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Example #3
0
 protected internal override void Open(InstallOptions options)
 {
     Form.NextButton.Enabled     = sqlButton.Enabled = sqlDataSourceComboBox.Enabled = sqlDatabaseTextBox.Enabled = false;
     sqlDatabaseStatusLabel.Text = string.Empty;
     sqlDataSourceComboBox.Text  = SuccessInstance;
     sqlDatabaseTextBox.Text     = SuccessDatabase;
     sqlDataSourceComboBox.Items.Clear();
     sqlDataSourceStatusLabel.Text = res.SqlInstanceWait;
     Application.DoEvents();
     new Thread(detectInstances).Start();
 }
Example #4
0
 protected internal override void Open(InstallOptions options)
 {
     if (!initialized)
     {
         initialized = true;
         if (Form.Operation == InstallOperation.Install)
         {
             AddLinks(options);
         }
     }
     Form.AbortButton.Enabled = true;
 }
        protected internal override void Open(InstallOptions options)
        {
            if (!AllowUpgrade)
            {
                upgradeRadioButton.Checked   = upgradeRadioButton.Enabled = false;
                upgradeDescriptionLabel.Text = Properties.Resources.NoUpgrade;
            }
            bool enable = upgradeRadioButton.Checked || removeRadioButton.Checked;

            Form.Operation          = InstallOperation.Upgrade;
            Form.NextButton.Enabled = enable;
        }
Example #6
0
        protected internal override void Open(InstallOptions options)
        {
            if (checks == null)
            {
                Form.NextButton.Enabled = false;
                Form.PrevButton.Enabled = false;

                checks = new SystemCheckList();
                InitializeChecks();

                timer.Interval = 100;
                timer.Tick    += new EventHandler(TimerEventProcessor);
                timer.Start();
            }
        }
 protected internal override void Open(InstallOptions options)
 {
     Form.PrevButton.Enabled = false;
     if (InstallConfiguration.ShowFinishedControl && Form.Operation == InstallOperation.Install)
     {
         Form.AbortButton.Enabled = false;
     }
     else
     {
         Form.AbortButton.Enabled = true;
     }
     if (string.IsNullOrEmpty(Details) && Form.NextButton.Enabled)
     {
         Form.NextButton.PerformClick();
     }
 }
        protected internal override void Close(InstallOptions options)
        {
            WebApplicationInfo appInfo;

            if (InstallConfiguration.RequireDeploymentToCentralAdminWebApplication)
            {
                for (int i = 0; i < webApplicationsCheckedListBox.Items.Count; i++)
                {
                    if (((appInfo = webApplicationsCheckedListBox.Items [i] as WebApplicationInfo) != null) && (appInfo.IsSRP || ((appInfo.Application != null) && appInfo.Application.IsAdministrationWebApplication)))
                    {
                        webApplicationsCheckedListBox.SetItemChecked(i, true);
                    }
                }
            }
            foreach (WebApplicationInfo info in webApplicationsCheckedListBox.CheckedItems)
            {
                options.Targets.Add(info.Application);
            }
        }
Example #9
0
 private void AddLinks(InstallOptions options)
 {
     // Show a documentation Url if one is configured
     if (!String.IsNullOrEmpty(InstallConfiguration.DocumentationUrl))
     {
         string linkText = InstallConfiguration.FormatString(res.ProductDocumentation);
         AddLink(linkText, 0, linkText.Length, InstallConfiguration.DocumentationUrl);
     }
     // Add the for each target
     if (((InstallConfiguration.FeatureScope == SPFeatureScope.Site) || InstallConfiguration.RequireDeploymentToAllContentWebApplications) &&
         !String.IsNullOrEmpty(InstallConfiguration.SiteCollectionRelativeConfigLink))
     {
         // Add site collection links
         AddSiteCollectionLinks(options.SiteCollectionTargets, FormatRelativeLink(InstallConfiguration.SiteCollectionRelativeConfigLink));
     }
     else if (((InstallConfiguration.FeatureScope == SPFeatureScope.Farm) || InstallConfiguration.RequireDeploymentToCentralAdminWebApplication) &&
              !String.IsNullOrEmpty(InstallConfiguration.SSPRelativeConfigLink))
     {
         // Add Shared Service Provider links
         // Note that thes are really Shared Resource Provider links - we just wish we knew how to only show links for a SSP and not SRPs
         AddSspLinks(options.Targets, FormatRelativeLink(InstallConfiguration.SSPRelativeConfigLink));
     }
 }
Example #10
0
 protected internal override void Close(InstallOptions options)
 {
 }
        protected internal override void Open(InstallOptions options)
        {
            executeCommands  = new CommandList();
            rollbackCommands = new CommandList();
            nextCommand      = 0;
            SPFeatureScope featureScope = InstallConfiguration.FeatureScope;
            DeactivateSiteCollectionFeatureCommand deactivateSiteCollectionFeatureCommand = null;

            switch (Form.Operation)
            {
            case InstallOperation.Install:
                executeCommands.Add(new AddSolutionCommand(this));
                if ((options.WebApplicationTargets != null) && (options.WebApplicationTargets.Count > 0))
                {
                    executeCommands.Add(new CreateDeploymentJobCommand(this, options.WebApplicationTargets));
                }
                else
                {
                    // KML TODO - need to get rid of options.Targets? - check with Lars
                    executeCommands.Add(new CreateDeploymentJobCommand(this, options.Targets));
                }
                executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitDeploy));
                if (featureScope == SPFeatureScope.Farm)
                {
                    executeCommands.Add(new ActivateFarmFeatureCommand(this));
                }
                else if (featureScope == SPFeatureScope.Site)
                {
                    executeCommands.Add(new ActivateSiteCollectionFeatureCommand(this, options.SiteCollectionTargets));
                }
                executeCommands.Add(new RegisterVersionNumberCommand(this));

                for (int i = executeCommands.Count - 1; i <= 0; i--)
                {
                    rollbackCommands.Add(executeCommands [i]);
                }
                break;

            case InstallOperation.Upgrade:
                if (featureScope == SPFeatureScope.Farm)
                {
                    executeCommands.Add(new DeactivateFarmFeatureCommand(this));
                }
                else if (featureScope == SPFeatureScope.Site)
                {
                    deactivateSiteCollectionFeatureCommand = new DeactivateSiteCollectionFeatureCommand(this);
                    executeCommands.Add(deactivateSiteCollectionFeatureCommand);
                }
                if (!IsSolutionRenamed())
                {
                    executeCommands.Add(new CreateUpgradeJobCommand(this));
                    executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitUpgrade));
                }
                else
                {
                    executeCommands.Add(new CreateRetractionJobCommand(this));
                    executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitRetract));
                    executeCommands.Add(new RemoveSolutionCommand(this));
                    executeCommands.Add(new AddSolutionCommand(this));
                    executeCommands.Add(new CreateDeploymentJobCommand(this, GetDeployedApplications()));
                    executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitDeploy));
                }
                if (featureScope == SPFeatureScope.Farm)
                {
                    executeCommands.Add(new ActivateFarmFeatureCommand(this));
                }
                if (featureScope == SPFeatureScope.Site)
                {
                    executeCommands.Add(new ActivateSiteCollectionFeatureCommand(this, deactivateSiteCollectionFeatureCommand.DeactivatedSiteCollections));
                }
                executeCommands.Add(new RegisterVersionNumberCommand(this));
                break;

            case InstallOperation.Repair:
                if (featureScope == SPFeatureScope.Farm)
                {
                    executeCommands.Add(new DeactivateFarmFeatureCommand(this));
                }
                if (featureScope == SPFeatureScope.Site)
                {
                    deactivateSiteCollectionFeatureCommand = new DeactivateSiteCollectionFeatureCommand(this);
                    executeCommands.Add(deactivateSiteCollectionFeatureCommand);
                }
                executeCommands.Add(new CreateRetractionJobCommand(this));
                executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitRetract));
                executeCommands.Add(new RemoveSolutionCommand(this));
                executeCommands.Add(new AddSolutionCommand(this));
                executeCommands.Add(new CreateDeploymentJobCommand(this, GetDeployedApplications()));
                executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitDeploy));
                if (featureScope == SPFeatureScope.Farm)
                {
                    executeCommands.Add(new ActivateFarmFeatureCommand(this));
                }
                if (featureScope == SPFeatureScope.Site)
                {
                    executeCommands.Add(new ActivateSiteCollectionFeatureCommand(this, deactivateSiteCollectionFeatureCommand.DeactivatedSiteCollections));
                }
                executeCommands.Add(new RegisterVersionNumberCommand(this));
                break;

            case InstallOperation.Uninstall:
                if (featureScope == SPFeatureScope.Farm)
                {
                    executeCommands.Add(new DeactivateFarmFeatureCommand(this));
                }
                if (featureScope == SPFeatureScope.Site)
                {
                    executeCommands.Add(new DeactivateSiteCollectionFeatureCommand(this));
                }
                executeCommands.Add(new CreateRetractionJobCommand(this));
                executeCommands.Add(new WaitForJobCompletionCommand(this, res.WaitRetract));
                executeCommands.Add(new RemoveSolutionCommand(this));
                executeCommands.Add(new UnregisterVersionNumberCommand(this));
                break;
            }

            progressBar.Maximum = executeCommands.Count;

            descriptionLabel.Text = executeCommands [0].Description;

            timer.Interval = 1000;
            timer.Tick    += new EventHandler(TimerEventInstall);
            timer.Start();
        }
 protected internal override void Close(InstallOptions options)
 {
     Form.ContentControls.Add(processControl);
 }
 protected internal override void Open(InstallOptions options)
 {
     Form.NextButton.Enabled = acceptCheckBox.Checked;
 }
 protected internal virtual void Close(InstallOptions options)
 {
 }
 protected internal virtual void Open(InstallOptions options)
 {
 }