Beispiel #1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            InitAI();
            TrackPageView(nameof(MainForm));

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

            if (!VaultManager.IsCompatiblePowershell())
            {
                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;
            }

            if (Properties.Settings.Default.ShowBetaWarning)
            {
                MessageBox.Show(Properties.Resources.BetaWarning, Properties.Resources.AppName);
            }

            /*if (this.VaultManager.IsValidVaultPath(Properties.Settings.Default.VaultPath))
             * {
             *  this.ReloadVault();
             * }*/
            var vaultInfo = VaultManager.GetVaultConfig();

            /*if (vaultInfo == null)
             * {
             *  LocateOrCreateVault(useDefaultCreationPath: false);
             *
             *  vaultInfo = VaultManager.GetVaultConfig();
             * }
             * else
             * {
             *  lblGettingStarted.Text = Properties.Resources.GettingStartedExistingVault;
             * }
             */

            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. Add a new contact now? ", "Create New Contact?", MessageBoxButtons.YesNo);

                if (promptResult == DialogResult.Yes)
                {
                    ShowContactRegistrationDialog();
                }
            }
            ReloadVault();
        }
Beispiel #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();
        }
Beispiel #3
0
        private void ReloadVault()
        {
            VaultManager.ReloadVaultConfig();
            var vaultInfo = VaultManager.GetVaultConfig();

            if (vaultInfo != null)
            {
                this.lblVaultLocation.Text = VaultManager.VaultFolderPath;
                this.lblAPIBaseURI.Text    = vaultInfo.BaseUri;

                populateTreeView(vaultInfo);

                txtOutput.Text = VaultManager.GetActionLogSummary();

                //store setting for current vault path
                if (Properties.Settings.Default.VaultPath != VaultManager.VaultFolderPath)
                {
                    Properties.Settings.Default.VaultPath = VaultManager.VaultFolderPath;
                    Properties.Settings.Default.Save();
                }
            }
        }
Beispiel #4
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();
        }