ImportSessionsFromSuperPutty1030() public static method

Import sessions from older version of SuperPuTTY from the Windows Registry
public static ImportSessionsFromSuperPutty1030 ( ) : void
return void
Beispiel #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();
                dlgFindPutty dialog = new dlgFindPutty();
                if (dialog.ShowDialog(SuperPuTTY.MainForm) == DialogResult.Cancel)
                {
                    System.Environment.Exit(1);
                }
            }

            if (String.IsNullOrEmpty(SuperPuTTY.Settings.PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                                "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }

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