Exemplo n.º 1
0
        public bool IsCompatiblePowershell()
        {
            int version = powershellManager.GetPowershellVersion();

            if (version < 4)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            InitAI();
            TrackPageView(nameof(MainForm));

            var powershellVersion = PowershellManager.GetPowershellVersion();

            if (powershellVersion < 4)
            {
                MessageBox.Show("This application requires PowerShell version 4.0 or higher. You can update it using the latest Windows Management Framework download from Microsoft.", Properties.Resources.AppName);

                Application.Exit();
                return;
            }

            this.VaultManager = new VaultManager(Properties.Settings.Default.VaultPath, LocalDiskVault.VAULT);

            PowershellManager manager = this.VaultManager.PowershellManager;

            /*if (!manager.IsAcmeSharpModuleInstalled())
             * {
             *  if (MessageBox.Show("The required PowerShell module 'ACMESharp' cannot be found. Please see https://www.powershellgallery.com/packages/ACMESharp/ or install from PowerShell command line as an administrator using: 'Install-Module -Name ACMESharp'",
             *          "ACMESharp Missing", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
             *  {
             *      // Application.Exit();
             *  }
             * }*/

            if (Properties.Settings.Default.ShowBetaWarning)
            {
                this.lblGettingStarted.Text += "\r\n\r\n" + Properties.Resources.BetaWarning;
            }

            var vaultInfo = VaultManager.GetVaultConfig();

            if (vaultInfo != null && vaultInfo.Registrations == null)
            {
                //got an existing vault. If no contact registrations setup, prompt to add one
                var promptResult = MessageBox.Show("No certificate contact registrations have been setup. Would you like to add a new contact now? ", "Create New Contact?", MessageBoxButtons.YesNo);

                if (promptResult == DialogResult.Yes)
                {
                    ShowContactRegistrationDialog();
                }
            }
            ReloadVault();
        }
Exemplo n.º 3
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            InitAI();
            TrackPageView(nameof(MainForm));

            if (this.requirePowershell)
            {
                var powershellVersion = PowershellManager.GetPowershellVersion();
                if (powershellVersion < 4)
                {
                    MessageBox.Show("This application requires PowerShell version 4.0 or higher. You can update it using the latest Windows Management Framework download from Microsoft.", Properties.Resources.AppName);

                    Application.Exit();
                    return;
                }
            }

            this.VaultManager = new VaultManager(Properties.Settings.Default.VaultPath, LocalDiskVault.VAULT);

            if (Properties.Settings.Default.ShowBetaWarning)
            {
                // this.lblGettingStarted.Text += "\r\n\r\n" + Properties.Resources.BetaWarning;
            }

            var vaultInfo = VaultManager.GetVaultConfig();

            if (vaultInfo != null && vaultInfo.Registrations == null)
            {
                //got an existing vault. If no contact registrations setup, prompt to add one
                var promptResult = MessageBox.Show("No certificate contact registrations have been setup. Would you like to add a new contact now? ", "Create New Contact?", MessageBoxButtons.YesNo);

                if (promptResult == DialogResult.Yes)
                {
                    ShowContactRegistrationDialog();
                }
            }
            ReloadVault();
        }