|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace AM2RLauncherLib;
|
|
|
|
|
|
|
|
|
|
@ -52,6 +53,11 @@ public static class OS
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static readonly bool IsThisRunningFromWine = CheckIfRunFromWINE();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if this is run via Flatpak.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static readonly bool IsThisRunningFromFlatpak = CheckIfRunFromFlatpak();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if the Launcher is ran from WINE.
|
|
|
|
|
/// </summary>
|
|
|
|
|
@ -65,4 +71,18 @@ public static class OS
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if the Launcher is ran from a Flatpak.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>see langword="true"/> if run from a Flatpak, <see langword="false"/> if not.</returns>
|
|
|
|
|
private static bool CheckIfRunFromFlatpak()
|
|
|
|
|
{
|
|
|
|
|
if (!IsLinux) return false;
|
|
|
|
|
|
|
|
|
|
// This file is present in all flatpaks
|
|
|
|
|
if (File.Exists("/.flatpak-info"))
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|