From 55b90c2b413a857d77fc9544af47917a491b2758 Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Mon, 18 Apr 2022 18:36:53 -0700 Subject: [PATCH] Fix windows-only code warnings in ReleaseGameRunner --- EndlessClient/GameExecution/ReleaseGameRunner.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/EndlessClient/GameExecution/ReleaseGameRunner.cs b/EndlessClient/GameExecution/ReleaseGameRunner.cs index 13a983be6..456ad381d 100644 --- a/EndlessClient/GameExecution/ReleaseGameRunner.cs +++ b/EndlessClient/GameExecution/ReleaseGameRunner.cs @@ -1,4 +1,6 @@ using System; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; #if !LINUX using System.Windows.Forms; #endif @@ -28,6 +30,8 @@ public override bool SetupDependencies() "Dependency setup error!", MessageBoxButtons.OK, MessageBoxIcon.Error); +#else + throw; #endif return false; } @@ -42,12 +46,18 @@ public override void RunGame() catch (Exception ex) { #if !LINUX - ShowExceptionDialog(ex); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + ShowExceptionDialog(ex); + else + throw; +#else + throw; #endif } } #if !LINUX + [SupportedOSPlatform("Windows")] private static void ShowExceptionDialog(Exception ex) { Application.EnableVisualStyles();