diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index a00319c79..30d96f1b2 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -47,6 +47,8 @@ namespace Flow.Launcher.Plugin.Shell Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Microsoft\WindowsApps\wt.exe"), }; + private static readonly bool IsAdmin = IsAdministrator(); + private Settings _settings; public List Query(Query query) @@ -518,5 +520,12 @@ namespace Flow.Launcher.Plugin.Shell { Context.API.RemoveGlobalKeyboardCallback(API_GlobalKeyboardEvent); } + + private static bool IsAdministrator() + { + using var identity = WindowsIdentity.GetCurrent(); + var principal = new WindowsPrincipal(identity); + return principal.IsInRole(WindowsBuiltInRole.Administrator); + } } }