/// <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(); } }
private void puTTYScpLocationToolStripMenuItem_Click(object sender, EventArgs e) { dlgFindPutty dialog = new dlgFindPutty(); if (dialog.ShowDialog() == DialogResult.OK) { PuttyExe = dialog.PuttyLocation; PscpExe = dialog.PscpLocation; } }
public frmSuperPutty() { // Get Registry Entry for Putty Exe RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Jim Radford\SuperPuTTY\Settings"); if (key != null) { string puttyExe = key.GetValue("PuTTYExe", "").ToString(); if (File.Exists(puttyExe)) { PuttyExe = puttyExe; } string pscpExe = key.GetValue("PscpExe", "").ToString(); if (File.Exists(pscpExe)) { PscpExe = pscpExe; } } if (String.IsNullOrEmpty(PuttyExe)) { dlgFindPutty dialog = new dlgFindPutty(); if (dialog.ShowDialog() == DialogResult.OK) { PuttyExe = dialog.PuttyLocation; PscpExe = dialog.PscpLocation; } } if (String.IsNullOrEmpty(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); } InitializeComponent(); #if DEBUG // Only show the option for the debug log viewer when we're compiled with DEBUG defined. debugLogToolStripMenuItem.Visible = true; #endif dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged; /* * Open the session treeview and dock it on the right */ m_Sessions = new SessionTreeview(dockPanel1); m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight); }
private void editLocations() { dlgFindPutty dialog = new dlgFindPutty(); if (dialog.ShowDialog() == DialogResult.OK) { this.m_db.SetKey("putty_exe", dialog.PuttyLocation); this.m_db.SetKey("pscp_exe", dialog.PscpLocation); this.m_db.SetKey("mintty_exe", dialog.MinttyLocation); PuttyExe = dialog.PuttyLocation; PscpExe = dialog.PscpLocation; MinttyExe = dialog.MinttyLocation; } }
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { SuperPuTTY.ReportStatus("Editing Options"); dlgFindPutty dialog = new dlgFindPutty(); if (dialog.ShowDialog(this) == DialogResult.OK) { ApplySettings(); } SuperPuTTY.ReportStatus("Ready"); }
public frmSuperPutty(string[] args) { // Check SQLite Database openOrCreateSQLiteDatabase(); #region Exe Paths // Get putty executable path if (File.Exists(this.m_db.GetKey("putty_exe"))) { PuttyExe = this.m_db.GetKey("putty_exe"); } // Get pscp executable path if (File.Exists(this.m_db.GetKey("pscp_exe"))) { PscpExe = this.m_db.GetKey("pscp_exe"); } if (String.IsNullOrEmpty(PuttyExe)) { dlgFindPutty dialog = new dlgFindPutty(); if (dialog.ShowDialog() == DialogResult.OK) { this.m_db.SetKey("putty_exe", dialog.PuttyLocation); this.m_db.SetKey("pscp_exe", dialog.PscpLocation); PuttyExe = this.m_db.GetKey("putty_exe"); PscpExe = this.m_db.GetKey("pscp_exe"); } } if (String.IsNullOrEmpty(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); } #endregion InitializeComponent(); #if DEBUG // Only show the option for the debug log viewer when we're compiled with DEBUG defined. debugLogToolStripMenuItem.Visible = true; #endif //Activate PasswordChar for passwordfield in connectbar PasswordTextBox.TextBox.UseSystemPasswordChar = true; //Select protocol SSH ProtocolBox.SelectedItem = ProtocolBox.Items[0]; dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged; /* * Open the session treeview and dock it on the right */ m_Sessions = new SessionTreeview(dockPanel1); m_Sessions.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight); /* * Parsing CL Arguments */ ParseClArguments(args); // Check for updates. checkForUpdate(true); }
public frmSuperPutty(string[] args) { // Check SQLite Database openOrCreateSQLiteDatabase(); #region Exe Paths // Get putty executable path if (File.Exists(this.m_db.GetKey("putty_exe"))) { PuttyExe = this.m_db.GetKey("putty_exe"); } // Get pscp executable path if (File.Exists(this.m_db.GetKey("pscp_exe"))) { PscpExe = this.m_db.GetKey("pscp_exe"); } if (String.IsNullOrEmpty(PuttyExe)) { dlgFindPutty dialog = new dlgFindPutty(); if (dialog.ShowDialog() == DialogResult.OK) { this.m_db.SetKey("putty_exe", dialog.PuttyLocation); this.m_db.SetKey("pscp_exe", dialog.PscpLocation); PuttyExe = this.m_db.GetKey("putty_exe"); PscpExe = this.m_db.GetKey("pscp_exe"); } } if (String.IsNullOrEmpty(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); } #endregion InitializeComponent(); #if DEBUG // Only show the option for the debug log viewer when we're compiled with DEBUG defined. debugLogToolStripMenuItem.Visible = true; #endif //Activate PasswordChar for passwordfield in connectbar PasswordTextBox.TextBox.UseSystemPasswordChar = true; //Select protocol SSH ProtocolBox.SelectedItem = ProtocolBox.Items[0]; dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged; /* * Open the session treeview and dock it on the right */ m_Sessions = new SessionTreeview(this, dockPanel1); if (Classes.Database.GetBooleanKey("ShowSessionTreeview", true)) { showSessionTreeview(); } /* * Parsing CL Arguments */ ParseClArguments(args); // First time automatic update check firstTimeAutomaticUpdateCheck(); // Set automatic update check menu item setAutomaticUpdateCheckMenuItem(); // Set addtional timing menu item setAdditionalTimingMenuItem(); // Check for updates. checkForUpdate(true); // Set window state and size setWindowStateAndSize(); }