mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Show message box to ask users to restart as administrator when encountering issue checking startup
This commit is contained in:
parent
479b49db94
commit
c3ec002b72
1 changed files with 13 additions and 2 deletions
|
|
@ -240,10 +240,21 @@ namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
Helper.AutoStartup.CheckIsEnabled(_settings.UseLogonTaskForStartup, _settings.AlwaysRunAsAdministrator);
|
Helper.AutoStartup.CheckIsEnabled(_settings.UseLogonTaskForStartup, _settings.AlwaysRunAsAdministrator);
|
||||||
}
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
// If it fails for permission, we need to ask the user to restart as administrator
|
||||||
|
if (API.ShowMsgBox(
|
||||||
|
API.GetTranslation("runAsAdministratorChangeAndRestart"),
|
||||||
|
API.GetTranslation("runAsAdministratorChange"),
|
||||||
|
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
RestartAppAsAdministrator();
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// but if it fails (permissions, etc) then don't keep retrying
|
// But if it fails for other reasons then do not keep retrying,
|
||||||
// this also gives the user a visual indication in the Settings widget
|
// set startup to false to give users a visual indication in the general page
|
||||||
_settings.StartFlowLauncherOnSystemStartup = false;
|
_settings.StartFlowLauncherOnSystemStartup = false;
|
||||||
API.ShowMsg(API.GetTranslation("setAutoStartFailed"), e.Message);
|
API.ShowMsg(API.GetTranslation("setAutoStartFailed"), e.Message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue