diff --git a/src/XIVLauncher.Common.Unix/UnixGameRunner.cs b/src/XIVLauncher.Common.Unix/UnixGameRunner.cs index e612377de..9ed9da22d 100644 --- a/src/XIVLauncher.Common.Unix/UnixGameRunner.cs +++ b/src/XIVLauncher.Common.Unix/UnixGameRunner.cs @@ -1,6 +1,7 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using XIVLauncher.Common.Dalamud; using XIVLauncher.Common.PlatformAbstractions; using XIVLauncher.Common.Unix.Compatibility; @@ -24,6 +25,14 @@ public UnixGameRunner(CompatibilityTools compatibility, DalamudLauncher dalamudL { if (dalamudOk) { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + environment.Add("XL_PLATFORM", "Linux"); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + environment.Add("XL_PLATFORM", "MacOS"); + } return this.dalamudLauncher.Run(new FileInfo(path), arguments, environment); } else @@ -31,4 +40,4 @@ public UnixGameRunner(CompatibilityTools compatibility, DalamudLauncher dalamudL return compatibility.RunInPrefix($"\"{path}\" {arguments}", workingDirectory, environment, writeLog: true); } } -} \ No newline at end of file +} diff --git a/src/XIVLauncher.Common.Windows/WindowsGameRunner.cs b/src/XIVLauncher.Common.Windows/WindowsGameRunner.cs index 229fcc943..164ae9b34 100644 --- a/src/XIVLauncher.Common.Windows/WindowsGameRunner.cs +++ b/src/XIVLauncher.Common.Windows/WindowsGameRunner.cs @@ -32,6 +32,7 @@ public Process Start(string path, string workingDirectory, string arguments, IDi _ => throw new ArgumentOutOfRangeException() }; environment.Add("__COMPAT_LAYER", compat); + environment.Add("XL_PLATFORM", "Windows"); var prevDalamudRuntime = Environment.GetEnvironmentVariable("DALAMUD_RUNTIME"); if (string.IsNullOrWhiteSpace(prevDalamudRuntime)) @@ -44,4 +45,4 @@ public Process Start(string path, string workingDirectory, string arguments, IDi return NativeAclFix.LaunchGame(workingDirectory, path, arguments, environment, dpiAwareness, process => { }); } } -} \ No newline at end of file +}