From 3cb52ba3f19f99400739d9134d2aa25800107db7 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Sun, 17 Sep 2017 11:10:32 -0500 Subject: [PATCH] rearranged program init to ensure ConDefaultPassword is decrypted before assignment to DefaultConnectionInfo object --- mRemoteV1/App/Startup.cs | 2 -- mRemoteV1/UI/Forms/frmMain.cs | 11 +++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mRemoteV1/App/Startup.cs b/mRemoteV1/App/Startup.cs index 01943d5a2..c8f95ccb7 100644 --- a/mRemoteV1/App/Startup.cs +++ b/mRemoteV1/App/Startup.cs @@ -42,8 +42,6 @@ namespace mRemoteNG.App ParseCommandLineArgs(); IeBrowserEmulation.Register(); GetConnectionIcons(); - DefaultConnectionInfo.Instance.LoadFrom(Settings.Default, a=>"ConDefault"+a); - DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, a=>"InhDefault"+a); } private static void GetConnectionIcons() diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index f9357e194..d6ec6c0f2 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -187,8 +187,9 @@ namespace mRemoteNG.UI.Forms // Create gui config load and save objects var settingsLoader = new SettingsLoader(this); settingsLoader.LoadSettings(); - - ApplyLanguage(); + LoadDefaultConnectionInfo(); + + ApplyLanguage(); PopulateQuickConnectProtocolMenu(); ThemeManager.ThemeChanged += ApplyThemes; ApplyThemes(); @@ -221,6 +222,12 @@ namespace mRemoteNG.UI.Forms ConnectionTreeWindow = Windows.TreeForm; } + private void LoadDefaultConnectionInfo() + { + DefaultConnectionInfo.Instance.LoadFrom(Settings.Default, a => "ConDefault" + a); + DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, a => "InhDefault" + a); + } + private void ApplyLanguage() { mMenFile.Text = Language.strMenuFile;