Skip to content

Commit

Permalink
fixed ui on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik518 committed Feb 16, 2024
1 parent 55dbc93 commit 1da695e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions SoG_SGreader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using SoG_SGreader.Wrapper;
using CommandLine;
using System.Diagnostics;
using System.Security.Cryptography;

namespace SoG_SGreader
{
Expand All @@ -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)
Expand All @@ -34,10 +36,14 @@ public static void Main(string[] args)
Parser.Default
.ParseArguments<ComandLineOptions>(args)
.WithParsed(RunOptions);
}
}
else
{
FreeConsole();
if (pid == PlatformID.Win32NT || pid == PlatformID.Win32S ||
pid == PlatformID.Win32Windows || pid == PlatformID.WinCE)
{
FreeConsole();
}
RunApp();
}
}
Expand Down

0 comments on commit 1da695e

Please sign in to comment.