From 4862a2d8163c821fe16a05a465576c9b80b78b4e Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 16 Jun 2025 21:58:49 +0800 Subject: [PATCH] Check if the application is running as administrator ealier --- Flow.Launcher/App.xaml.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 5d5f3dd35..5ce2580de 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -59,13 +59,6 @@ namespace Flow.Launcher // Initialize settings _settings.WMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled(); - // Check if the application is running as administrator - if (_settings.AlwaysRunAsAdministrator && !Win32Helper.IsAdministrator()) - { - RestartApp(true); - return; - } - // Configure the dependency injection container try { @@ -143,6 +136,13 @@ namespace Flow.Launcher return; } + // Check if the application is running as administrator + if (_settings.AlwaysRunAsAdministrator && !Win32Helper.IsAdministrator()) + { + RestartApp(true); + return; + } + // Initialize system language before changing culture info Internationalization.InitSystemLanguageCode();