I have an app on Steam, and normally when I want to know what operating system I am using, then I use TOSVersion.Name from System.SysUtils.
And that works except when I run it through Steam Proton on Linux, then it says I'm running it on Windows, even though I'm on Linux.
But surely there must be a way to detect or know when the app is run through Steam Proton?
How can I detect when the app is run through Steam Proton (Linux)?
After digging around, I found this post mentioning to check /etc/os-release.
So, I managed to figure out that you can use the following function to know if your app is running through Proton (Linux) or not:
function isLinuxViaSteamProton: Boolean;
begin
Result := FileExists('/etc/os-release');
end;
I tested it with various different Proton versions as well as various different Linux systems. It works with all of them.
If the function returns true, then your app is run from Steam Proton (Linux).
If the function returns false, then you're using Windows or whatever else the TOSVersion.Name function returns.