File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -240,10 +240,21 @@ private void AutoStartup()
240240 {
241241 Helper . AutoStartup . CheckIsEnabled ( _settings . UseLogonTaskForStartup , _settings . AlwaysRunAsAdministrator ) ;
242242 }
243+ catch ( UnauthorizedAccessException )
244+ {
245+ // If it fails for permission, we need to ask the user to restart as administrator
246+ if ( API . ShowMsgBox (
247+ API . GetTranslation ( "runAsAdministratorChangeAndRestart" ) ,
248+ API . GetTranslation ( "runAsAdministratorChange" ) ,
249+ MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
250+ {
251+ RestartAppAsAdministrator ( ) ;
252+ }
253+ }
243254 catch ( Exception e )
244255 {
245- // but if it fails (permissions, etc) then don't keep retrying
246- // this also gives the user a visual indication in the Settings widget
256+ // But if it fails for other reasons then do not keep retrying,
257+ // set startup to false to give users a visual indication in the general page
247258 _settings . StartFlowLauncherOnSystemStartup = false ;
248259 API . ShowMsg ( API . GetTranslation ( "setAutoStartFailed" ) , e . Message ) ;
249260 }
You can’t perform that action at this time.
0 commit comments