Beispiel #1
0
        private static bool CheckRequirements()
        {
            bool pass = true;

            // Check for Win2K or later
            bool osRequirement = OS.CheckOSRequirement();

            pass &= osRequirement;

            // Check for admin
            bool isAdmin = Security.IsAdministrator;

            pass &= isAdmin;

            // Show error if necessary
            if (!pass)
            {
                string title   = PdnInfo.GetBareProductName();
                string message = "internal error";

                if (!osRequirement)
                {
                    message = PdnResources.GetString("Error.OSRequirement");
                }
                else if (!isAdmin)
                {
                    message = PdnResources.GetString("SetupWizard.Error.AdminRequired");
                }

                MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(pass);
        }
Beispiel #2
0
        private static void ShowHelp()
        {
            string title    = PdnInfo.GetBareProductName();
            string helpText = PdnResources.GetString("SetupWizard.HelpText");

            MessageBox.Show(helpText, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        public override void OnNextClicked()
        {
            bool ok = true;

            DirectoryInfo info = new DirectoryInfo(this.targetDirTextBox.Text);

            if (!info.Exists)
            {
                try
                {
                    info.Create();
                    info.Delete();
                }

                catch
                {
                    ok = false;
                    string title   = PdnInfo.GetBareProductName();
                    string message = PdnResources.GetString("SetupWizard.InstallDirPage.BadDirError.Message");
                    MessageBox.Show(this, message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            if (ok)
            {
                WizardHost.SetMsiProperty(PropertyNames.TargetDir, this.targetDirTextBox.Text);
                WizardHost.GoToPage(typeof(ReadyToInstallPage));
            }

            base.OnNextClicked();
        }
Beispiel #4
0
        public ReadyToInstallPage()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            string introFormat = PdnResources.GetString("SetupWizard.ReadyToInstallPage.IntroText.Text.Format");
            string appName     = PdnInfo.GetBareProductName();

            this.introText.Text = string.Format(introFormat, appName);
        }
Beispiel #5
0
 public ResizeProgressDialog(Control owner, Document dst, Document src, Size newSize, ResamplingAlgorithm algorithm)
     : base(owner, PdnInfo.GetBareProductName(), PdnResources.GetString("ResizeAction.ProgressDialog.Description"))
 {
     this.dst           = dst;
     this.src           = src;
     this.newSize       = newSize;
     this.algorithm     = algorithm;
     this.tilesPerLayer = 50 * Processor.LogicalCpuCount;
     this.maxTiles      = tilesPerLayer * src.Layers.Count;
     this.Icon          = Utility.ImageToIcon(StaticImage.Reference);
 }
        public InstallDirPage()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            string appName     = PdnInfo.GetBareProductName();
            string introFormat = PdnResources.GetString("SetupWizard.InstallDirPage.IntroText.Text.Format");

            this.introText.Text    = string.Format(introFormat, appName);
            this.folderLabel.Text  = PdnResources.GetString("SetupWizard.InstallDirPage.FolderLabel.Text");
            this.browseButton.Text = PdnResources.GetString("SetupWizard.InstallDirPage.BrowseButton.Text");
        }
Beispiel #7
0
        protected override void OnClosing(CancelEventArgs e)
        {
            if (!this.finished)
            {
                string       title   = PdnInfo.GetBareProductName();
                string       message = PdnResources.GetString("SetupWizard.CancelDialog.Message");
                DialogResult result  = MessageBox.Show(this, message, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.No)
                {
                    e.Cancel = true;
                }
            }

            base.OnClosing(e);
        }
Beispiel #8
0
        public IntroPage()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            string expireTextFormat = PdnResources.GetString("SetupWizard.IntroPage.ExpirationWarning.Format");
            string expireText;

            if (PdnInfo.IsFinalBuild)
            {
                expireText = string.Empty;
            }
            else
            {
                expireText = string.Format(expireTextFormat, PdnInfo.ExpirationDate.ToLongDateString());
            }

            string introFormat    = PdnResources.GetString("SetupWizard.IntroPage.IntroText.Text.Format");
            string appNameWithTag = PdnInfo.GetBareProductName();
            string intro          = string.Format(introFormat, appNameWithTag);

            this.introText.Text = intro;

            this.quickRB.Text           = PdnResources.GetString("SetupWizard.IntroPage.QuickRB.Text");
            this.quickDescription.Text  = PdnResources.GetString("SetupWizard.IntroPage.QuickDescription.Text");
            this.customRB.Text          = PdnResources.GetString("SetupWizard.IntroPage.CustomRB.Text");
            this.customDescription.Text = PdnResources.GetString("SetupWizard.IntroPage.CustomDescription.Text");

            if (IntroPage.UserChoseQuickSetup)
            {
                this.quickRB.Checked = true;
            }
            else
            {
                this.customRB.Checked = true;
            }

            string format            = InvariantStrings.CopyrightFormat;
            string allRightsReserved = PdnResources.GetString("Application.Copyright.AllRightsReserved");
            string copyright         = string.Format(CultureInfo.CurrentCulture, format, allRightsReserved);

            this.copyrightLabel.Text = copyright;
        }
        public InstallingPage()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            string introFormat = PdnResources.GetString("SetupWizard.InstallingPage.InfoText.Text.Installing.Format");

            this.appName        = PdnInfo.GetBareProductName();
            this.installingText = string.Format(introFormat, appName);

            this.uninstallingText = PdnResources.GetString("SetupWizard.InstallingPage.InfoText.Text.Uninstalling");
            this.optimizingText   = PdnResources.GetString("SetupWizard.InstallingPage.InfoText.Text.Optimizing");

            this.pdnDonateBannerImage = new Bitmap(bannerSize.Width, bannerSize.Height, PixelFormat.Format24bppRgb);

            using (Graphics g = Graphics.FromImage(this.pdnDonateBannerImage))
            {
                RenderPdnDonateBannerImage(g, new Rectangle(Point.Empty, this.pdnDonateBannerImage.Size));
            }

            this.topBanner.Image = this.pdnDonateBannerImage;
            this.topBanner.Tag   = InvariantStrings.DonateUrlSetup;
            this.toolTip.SetToolTip(this.topBanner, InvariantStrings.DonateUrlSetup);

            Image  mirrorImage;
            string mirrorClickUrl;

            LoadMirrorInfo(out mirrorImage, out mirrorClickUrl);

            if (mirrorImage != null && mirrorClickUrl != null)
            {
                this.bottomBanner.Image = mirrorImage;
                this.bottomBanner.Tag   = mirrorClickUrl;
                this.toolTip.SetToolTip(this.bottomBanner, mirrorClickUrl);
            }
        }