예제 #1
0
        /// <summary>
        /// Check that putty can be found.  If not, prompt the user
        /// </summary>
        public static void PuttyCheck()
        {
            if (string.IsNullOrEmpty(SuperPuTTY.Settings.PuttyExe) || SuperPuTTY.IsFirstRun || !File.Exists(SuperPuTTY.Settings.PuttyExe))
            {
                // first time, try to import old putty settings from registry
                SuperPuTTY.Settings.ImportFromRegistry();
                SettingsDialog dialog = new SettingsDialog();
                if (dialog.ShowDialog(SuperPuTTY.MainForm) == DialogResult.Cancel)
                {
                    Environment.Exit(1);
                }
            }

            if (string.IsNullOrEmpty(SuperPuTTY.Settings.PuttyExe))
            {
                MessageBox.Show(LocalizedText.dlgFindPutty_PuttyCheck_Cannot_find_PuTTY_installation,
                                LocalizedText.dlgFindPutty_PuttyCheck_PuTTY_Not_Found, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                Environment.Exit(1);
            }

            if (SuperPuTTY.IsFirstRun && SuperPuTTY.Sessions.Count == 0)
            {
                // first run, got nothing...try to import from registry
                SuperPuTTY.ImportSessionsFromSuperPutty1030();
            }
        }