diff --git a/SoG_SGreader/Program.cs b/SoG_SGreader/Program.cs index b353ca5..43489b4 100644 --- a/SoG_SGreader/Program.cs +++ b/SoG_SGreader/Program.cs @@ -4,6 +4,7 @@ using SoG_SGreader.Wrapper; using CommandLine; using System.Diagnostics; +using System.Security.Cryptography; namespace SoG_SGreader { @@ -20,9 +21,10 @@ public static class Program [STAThread] public static void Main(string[] args) { + PlatformID pid = Environment.OSVersion.Platform; + if (args.Length > 0) { - PlatformID pid = Environment.OSVersion.Platform; // If on Windows, allocate a console. if (pid == PlatformID.Win32NT || pid == PlatformID.Win32S || pid == PlatformID.Win32Windows || pid == PlatformID.WinCE) @@ -34,10 +36,14 @@ public static void Main(string[] args) Parser.Default .ParseArguments(args) .WithParsed(RunOptions); - } + } else { - FreeConsole(); + if (pid == PlatformID.Win32NT || pid == PlatformID.Win32S || + pid == PlatformID.Win32Windows || pid == PlatformID.WinCE) + { + FreeConsole(); + } RunApp(); } }