Files
wunker-os/files/spyro2-client-patch/linux-support.patch
2025-12-29 15:36:58 -05:00

27 lines
853 B
Diff

diff --git a/source/S2AP/App.axaml.cs b/source/S2AP/App.axaml.cs
index 609ebb9..77ba22d 100644
--- a/source/S2AP/App.axaml.cs
+++ b/source/S2AP/App.axaml.cs
@@ -18,6 +18,7 @@ using ReactiveUI;
using S2AP.Models;
using Serilog;
using System;
+using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Concurrency;
@@ -52,9 +53,10 @@ public partial class App : Application
}
private static bool IsRunningAsAdministrator()
{
- var identity = WindowsIdentity.GetCurrent();
- var principal = new WindowsPrincipal(identity);
- return principal.IsInRole(WindowsBuiltInRole.Administrator);
+ return geteuid() == 0;
+
+ [DllImport("libc")]
+ static extern uint geteuid();
}
public override void OnFrameworkInitializationCompleted()