From a97f676595e3bf8643a35589d5ad10d8a74c6ad7 Mon Sep 17 00:00:00 2001 From: erri120 Date: Sun, 13 Nov 2022 12:24:53 +0100 Subject: [PATCH] Improve admin check --- Wabbajack.App.Wpf/App.xaml.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Wabbajack.App.Wpf/App.xaml.cs b/Wabbajack.App.Wpf/App.xaml.cs index 60e839c5..a224e5d6 100644 --- a/Wabbajack.App.Wpf/App.xaml.cs +++ b/Wabbajack.App.Wpf/App.xaml.cs @@ -99,8 +99,12 @@ namespace Wabbajack try { var identity = WindowsIdentity.GetCurrent(); + var owner = identity.Owner; + if (owner is not null) return owner.IsWellKnown(WellKnownSidType.BuiltinAdministratorsSid); + var principle = new WindowsPrincipal(identity); return principle.IsInRole(WindowsBuiltInRole.Administrator); + } catch (Exception) {