private void InstallProcessControl_Load(object sender, EventArgs e)
        {
            switch (Form.Operation)
            {
            case InstallOperation.Install:
                Form.SetTitle(res.Installing);
                Form.SetSubTitle(InstallConfiguration.FormatString(res.WaitInstalling));
                break;

            case InstallOperation.Upgrade:
                Form.SetTitle(res.Upgrading);
                Form.SetSubTitle(InstallConfiguration.FormatString(res.WaitUpgrading));
                break;

            case InstallOperation.Repair:
                Form.SetTitle(res.Repairing);
                Form.SetSubTitle(InstallConfiguration.FormatString(res.WaitRepairing));
                break;

            case InstallOperation.Uninstall:
                Form.SetTitle(res.Removing);
                Form.SetSubTitle(InstallConfiguration.FormatString(res.WaitRemoving));
                break;
            }

            Form.PrevButton.Enabled = false;
            Form.NextButton.Enabled = false;
        }
示例#2
0
            protected override SystemCheckResult DoExecute()
            {
                Guid solutionId = Guid.Empty;

                try {
                    solutionId = InstallConfiguration.SolutionId;
                } catch (ArgumentNullException) {
                    throw new InstallException(res.ConfigErrorNoSolutionID);
                } catch (FormatException) {
                    throw new InstallException(res.ConfigErrorInvalidSolutionID);
                }

                try {
                    solution = SPFarm.Local.Solutions [solutionId];
                    if (solution != null)
                    {
                        this.OkText = InstallConfiguration.FormatString(res.SolutionInstalled);
                    }
                    else
                    {
                        this.OkText = InstallConfiguration.FormatString(res.SolutionNotInstalled);
                    }
                } catch (NullReferenceException) {
                    throw new InstallException(res.SpDbError);
                } catch (Exception ex) {
                    throw new InstallException(ex.Message, ex);
                }

                return(SystemCheckResult.Success);
            }
示例#3
0
        private void AddSspLinks(IList webApplicationTargets, string relativeLink)
        {
            SPWebApplication webApp;
            string           linkText;

            foreach (object webAppObj in webApplicationTargets)
            {
                if ((webApp = webAppObj as SPWebApplication) != null)
                {
                    if (webApp.Sites.Count > 0)
                    {
                        foreach (SPSite site in webApp.Sites)
                        {
                            try {
                                AddLink(linkText = InstallConfiguration.FormatString(res.ConfigButton, site.Url, InstallConfiguration.SolutionShortName), 0, linkText.Length, site.Url + relativeLink);
                                break;
                            } catch {
                            }
                        }
                    }
                    else if (webApp.AlternateUrls.Count > 0)
                    {
                        foreach (SPAlternateUrl url in webApp.AlternateUrls)
                        {
                            if (!string.IsNullOrEmpty(url.IncomingUrl))
                            {
                                AddLink(linkText = InstallConfiguration.FormatString(res.ConfigButton, url, InstallConfiguration.SolutionShortName), 0, linkText.Length, url + relativeLink);
                            }
                        }
                    }
                }
            }
        }
        public RepairControl(bool allowRepair)
        {
            AllowRepair         = allowRepair;
            this.processControl = Program.CreateProcessControl();
            InitializeComponent();

            messageLabel.Text = InstallConfiguration.FormatString(messageLabel.Text);
        }
示例#5
0
 private void AddSiteCollectionLinks(List <SPSite> siteCollectionTargets, string relativeLink)
 {
     foreach (SPSite siteCollection in siteCollectionTargets)
     {
         string linkText = InstallConfiguration.FormatString(res.ConfigButton, siteCollection.Url, InstallConfiguration.SolutionShortName);
         AddLink(linkText, 0, linkText.Length, siteCollection.Url + relativeLink);
     }
 }
        internal static InstallerControl CreateWelcomeControl()
        {
            WelcomeControl control = new WelcomeControl();

            control.Title    = InstallConfiguration.FormatString(res.Welcome);
            control.SubTitle = InstallConfiguration.FormatString(res.Welcome2);
            return(control);
        }
        internal static InstallerControl CreateSystemCheckControl()
        {
            SystemCheckControl control = new SystemCheckControl();

            control.Title    = res.Check;
            control.SubTitle = InstallConfiguration.FormatString(res.Check2);

            control.RequireMOSS      = InstallConfiguration.RequireMoss;
            control.RequireSearchSKU = false;

            return(control);
        }
        private void removeHintLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string url = string.Empty;

            try {
                Process.Start(url = InstallConfiguration.GetConfigLink("wss"));
            } catch {
                if (!string.IsNullOrEmpty(url))
                {
                    MessageBox.Show("Open: " + url);
                }
            }
        }
        public UpgradeControl(bool allowUpgrade)
        {
            AllowUpgrade        = allowUpgrade;
            this.processControl = Program.CreateProcessControl();
            InitializeComponent();

            messageLabel.Text = InstallConfiguration.FormatString(messageLabel.Text);

            string upgradeDescription = InstallConfiguration.UpgradeDescription;

            if (!string.IsNullOrEmpty(upgradeDescription))
            {
                upgradeDescriptionLabel.Text = upgradeDescription;
            }
        }
 public WelcomeControl()
 {
     InitializeComponent();
     if (CultureInfo.CurrentUICulture.Name.StartsWith("de", StringComparison.InvariantCultureIgnoreCase))
     {
         langGermanRadioButton.Checked = true;
     }
     if (CultureInfo.CurrentUICulture.Name.StartsWith("fr", StringComparison.InvariantCultureIgnoreCase))
     {
         langFrenchRadioButton.Checked = true;
     }
     init = true;
     messageLabel.Text = InstallConfiguration.FormatString(messageLabel.Text);
     label2.Text       = InstallConfiguration.FormatString(label2.Text);
 }
示例#11
0
        private void FinalizeChecks()
        {
            if (errors == 0)
            {
                ConfigureControls();
                Form.NextButton.Enabled = true;
                messageLabel.Text       = res.CheckAllYes;
            }
            else
            {
                messageLabel.Text = InstallConfiguration.FormatString(res.CheckAllNo);
            }

            Form.PrevButton.Enabled = true;
        }
        private void languageComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string filename = InstallConfiguration.GetEula((languageComboBox.SelectedIndex == 1) ? "de_" : string.Empty);

            if (!String.IsNullOrEmpty(filename))
            {
                try {
                    this.richTextBox.LoadFile(filename);
                    acceptCheckBox.Enabled = true;
                } catch (IOException ex) {
                    this.richTextBox.Lines = new string [] { filename + ":", ex.Message };
                }
            }
            richTextBox.SelectionLength = richTextBox.SelectionStart = 0;
            richTextBox.ScrollToCaret();
        }
        public static void Main(string [] args)
        {
            byte [] data;
            string  fp2;

            try {
                foreach (string fp in Directory.GetFiles(Path.Combine(Application.StartupPath, "docs"), "*.chm", SearchOption.TopDirectoryOnly))
                {
                    try {
                        data = null;
                        using (FileStream fs = File.OpenRead(fp))
                            fs.Read(data = new byte [(int)fs.Length], 0, (int)fs.Length);
                        File.Delete(fp);
                        using (FileStream fs = File.Create(fp))
                            fs.Write(data, 0, data.Length);
                    } catch {
                    }
                }
            } catch {
            }
            try {
                if (File.Exists(fp2 = Path.Combine(Application.StartupPath, "files\\sqljdbc" + ((IntPtr.Size == 8) ? 64 : 32) + ".dll")))
                {
                    File.Copy(fp2, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "sqljdbc_auth.dll"), true);
                }
            } catch {
            }

            if ((args != null) && (args.Length > 0))
            {
                try {
                    Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo(args [0]);
                } catch {
                }
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            InstallerForm form = new InstallerForm();

            form.Text = InstallConfiguration.FormatString(res.SolutionTitle, InstallConfiguration.SolutionTitle, InstallConfiguration.SolutionVersion);

            form.ContentControls.Add(CreateWelcomeControl());
            form.ContentControls.Add(CreateSystemCheckControl());

            Application.Run(form);
        }
        void CompletionControl_Load(object sender, EventArgs e)
        {
            // Conditionally show the FinishedControl
            if (InstallConfiguration.ShowFinishedControl && Form.Operation == InstallOperation.Install)
            {
                FinishedControl finishedControl = new FinishedControl();
                finishedControl.Title    = res.Finished;
                finishedControl.SubTitle = InstallConfiguration.FormatString(res.Finished2);
                Form.ContentControls.Add(finishedControl);

                Form.NextButton.Enabled = true;
            }
            else
            {
                Form.AbortButton.Enabled = true;
            }
        }
示例#15
0
        private void AddInstallControls()
        {
            //
            // Add EULA control if an EULA file was specified.
            //
            string filename = InstallConfiguration.GetEula(string.Empty);

            if (!String.IsNullOrEmpty(filename))
            {
                Form.ContentControls.Add(Program.CreateEULAControl());
            }

            if ((!string.IsNullOrEmpty(InstallConfiguration.Sql)) && (File.Exists(InstallConfiguration.Sql) || ((!InstallConfiguration.Sql.Contains("\\")) && File.Exists(Path.Combine(Application.StartupPath, InstallConfiguration.Sql.TrimStart('\\'))))))
            {
                Form.ContentControls.Add(Program.CreateSqlControl());
            }

            Form.ContentControls.Add(Program.CreateDeploymentTargetsControl());
            //Form.ContentControls.Add(Program.CreateOptionsControl());
            Form.ContentControls.Add(Program.CreateProcessControl());
        }
示例#16
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));
     }
 }
示例#17
0
        private void InitializeChecks()
        {
            Guid guid;

            this.tableLayoutPanel.SuspendLayout();

            //
            // WSS Installed Check
            //
            WSSInstalledCheck wssCheck = new WSSInstalledCheck();

            wssCheck.QuestionText = res.CheckWss;
            wssCheck.OkText       = res.CheckWssYes;
            wssCheck.ErrorText    = res.CheckWssNo;
            AddCheck(wssCheck);

            //
            // MOSS Installed Check
            //
            if (requireMOSS)
            {
                MOSSInstalledCheck mossCheck = new MOSSInstalledCheck();
                mossCheck.QuestionText = res.CheckMoss;
                mossCheck.OkText       = res.CheckMossYes;
                mossCheck.ErrorText    = res.CheckMossNo;
                AddCheck(mossCheck);
            }

            //
            // Admin Rights Check
            //
            AdminRightsCheck adminRightsCheck = new AdminRightsCheck();

            adminRightsCheck.QuestionText = res.CheckAdmin;
            adminRightsCheck.OkText       = res.CheckAdminYes;
            adminRightsCheck.ErrorText    = res.CheckAdminNo;
            AddCheck(adminRightsCheck);

            //
            // Admin Service Check
            //
            AdminServiceCheck adminServiceCheck = new AdminServiceCheck();

            adminServiceCheck.QuestionText = res.CheckService;
            adminServiceCheck.OkText       = res.CheckServiceYes;
            adminServiceCheck.ErrorText    = res.CheckServiceNo;
            AddCheck(adminServiceCheck);

            //
            // Timer Service Check
            //
            TimerServiceCheck timerServiceCheck = new TimerServiceCheck();

            timerServiceCheck.QuestionText = res.CheckTimer;
            timerServiceCheck.OkText       = res.CheckTimerYes;
            timerServiceCheck.ErrorText    = res.CheckTimerNo;
            AddCheck(timerServiceCheck);

            //
            // Solution Package Check
            //
            SolutionFileCheck solutionFileCheck = new SolutionFileCheck();

            solutionFileCheck.QuestionText = InstallConfiguration.FormatString(res.CheckFile);
            solutionFileCheck.OkText       = InstallConfiguration.FormatString(res.CheckFileYes);
            solutionFileCheck.ErrorText    = InstallConfiguration.FormatString(res.CheckFileNo);
            AddCheck(solutionFileCheck);

            //
            // Solution Check
            //
            SolutionCheck solutionCheck = new SolutionCheck();

            solutionCheck.QuestionText = InstallConfiguration.FormatString(res.CheckSolution);
            solutionCheck.OkText       = InstallConfiguration.FormatString(res.CheckSolutionYes);
            solutionCheck.ErrorText    = InstallConfiguration.FormatString(res.CheckSolutionNo);
            AddCheck(solutionCheck);

            if (!string.IsNullOrEmpty(InstallConfiguration.Java))
            {
                JavaInstalledCheck javaCheck = new JavaInstalledCheck();
                javaCheck.QuestionText = string.Format(res.CheckJava, InstallConfiguration.Java);
                javaCheck.OkText       = string.Format(res.CheckJavaYes, InstallConfiguration.Java);
                javaCheck.ErrorText    = string.Format(res.CheckJavaNo, InstallConfiguration.Java);
                AddCheck(javaCheck);
            }

            if ((!string.IsNullOrEmpty(InstallConfiguration.LegacyLists)) && !Guid.Empty.Equals(guid = ProductPage.GetGuid(InstallConfiguration.LegacyLists, false)))
            {
                LegacyCheck legacyCheck = new LegacyCheck(guid);
                legacyCheck.ErrorText    = res.LegacyFail;
                legacyCheck.QuestionText = res.Legacy;
                legacyCheck.OkText       = res.LegacyOK;
                AddCheck(legacyCheck);
            }

            //
            // Add empty row that will eat up the rest of the
            // row space in the layout table.
            //
            this.tableLayoutPanel.RowCount++;
            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));

            this.tableLayoutPanel.ResumeLayout(false);
            this.tableLayoutPanel.PerformLayout();
        }