From 9d4bfbcb1c6bb506ae3a7366205a52d66c90c7c0 Mon Sep 17 00:00:00 2001 From: Dimitrij Date: Wed, 13 Dec 2023 21:56:25 +0000 Subject: [PATCH] lib updates --- ExternalConnectors/ExternalConnectors.csproj | 6 +++--- mRemoteNG/App/ProgramRoot.cs | 18 ++++++++++++++--- mRemoteNG/mRemoteNG.csproj | 21 ++++++++++---------- mRemoteNGSpecs/mRemoteNGSpecs.csproj | 10 +++++----- mRemoteNGTests/mRemoteNGTests.csproj | 4 ++-- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/ExternalConnectors/ExternalConnectors.csproj b/ExternalConnectors/ExternalConnectors.csproj index 53aecdcb..ba51ca93 100644 --- a/ExternalConnectors/ExternalConnectors.csproj +++ b/ExternalConnectors/ExternalConnectors.csproj @@ -15,10 +15,10 @@ - - + + + - diff --git a/mRemoteNG/App/ProgramRoot.cs b/mRemoteNG/App/ProgramRoot.cs index 605ecb94..abae3a00 100644 --- a/mRemoteNG/App/ProgramRoot.cs +++ b/mRemoteNG/App/ProgramRoot.cs @@ -3,9 +3,8 @@ using System.Diagnostics; using System.Drawing; using System.Runtime.Versioning; using System.Threading; -using System.Windows; using System.Windows.Forms; -using mRemoteNG.Properties; +using mRemoteNG.Config.Settings; using mRemoteNG.UI.Forms; namespace mRemoteNG.App @@ -22,6 +21,19 @@ namespace mRemoteNG.App [STAThread] public static void Main(string[] args) { + var settingsManager = new LocalSettingsManager(); + + // Check if the database exists + if (settingsManager.DatabaseExists()) + { + Console.WriteLine("Database exists."); + } + else + { + Console.WriteLine("Database does not exist. Creating..."); + settingsManager.CreateDatabase(); + } + if (Properties.OptionsStartupExitPage.Default.SingleInstance) StartApplicationAsSingleInstance(); else @@ -74,7 +86,7 @@ namespace mRemoteNG.App var singletonInstanceWindowHandle = GetRunningSingletonInstanceWindowHandle(); if (singletonInstanceWindowHandle == IntPtr.Zero) return; if (NativeMethods.IsIconic(singletonInstanceWindowHandle) != 0) - NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE); + _ = NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE); NativeMethods.SetForegroundWindow(singletonInstanceWindowHandle); } diff --git a/mRemoteNG/mRemoteNG.csproj b/mRemoteNG/mRemoteNG.csproj index 37b052ef..fa7d0e20 100644 --- a/mRemoteNG/mRemoteNG.csproj +++ b/mRemoteNG/mRemoteNG.csproj @@ -86,10 +86,11 @@ + - + @@ -99,24 +100,24 @@ - - - - + + + + + - - + - - + + - + diff --git a/mRemoteNGSpecs/mRemoteNGSpecs.csproj b/mRemoteNGSpecs/mRemoteNGSpecs.csproj index 0285e334..b7277a19 100644 --- a/mRemoteNGSpecs/mRemoteNGSpecs.csproj +++ b/mRemoteNGSpecs/mRemoteNGSpecs.csproj @@ -17,16 +17,16 @@ - - - + + + + - + - diff --git a/mRemoteNGTests/mRemoteNGTests.csproj b/mRemoteNGTests/mRemoteNGTests.csproj index 6d34f296..30d95b56 100644 --- a/mRemoteNGTests/mRemoteNGTests.csproj +++ b/mRemoteNGTests/mRemoteNGTests.csproj @@ -15,9 +15,9 @@ - + - +