Files
VRCX/Dotnet/Wine.cs
rs189 5e6c611264 Linux: Make Discord Rich Presence work (#998)
* Linux: Make Discord Rich Presence work

* Fix file already exists

* Fix chmod file name
2024-12-02 00:00:30 +13:00

23 lines
574 B
C#

using System;
using System.Runtime.InteropServices;
namespace VRCX
{
public static class Wine
{
[DllImport("ntdll.dll")]
private static extern IntPtr wine_get_version();
public static bool GetIfWine()
{
// wine_get_version should be guaranteed to exist exclusively in Wine envs,
// unlike some other suggestions like checking Wine registry keys
try
{
wine_get_version();
return true;
}
catch { return false; }
}
}
}