Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/XIVLauncher.Common.Unix/UnixGameRunner.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -24,11 +25,19 @@ 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
{
return compatibility.RunInPrefix($"\"{path}\" {arguments}", workingDirectory, environment, writeLog: true);
}
}
}
}
3 changes: 2 additions & 1 deletion src/XIVLauncher.Common.Windows/WindowsGameRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -44,4 +45,4 @@ public Process Start(string path, string workingDirectory, string arguments, IDi
return NativeAclFix.LaunchGame(workingDirectory, path, arguments, environment, dpiAwareness, process => { });
}
}
}
}