File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,18 @@ public async void RestartApp()
8585 // Wait for all image caches to be saved before restarting
8686 await ImageLoader . WaitSaveAsync ( ) ;
8787
88- // Restart requires Squirrel's Update.exe to be present in the parent folder,
89- // it is only published from the project's release pipeline. When debugging without it,
90- // the project may not restart or just terminates. This is expected.
91- UpdateManager . RestartApp ( Constant . ApplicationFileName ) ;
88+ // If app is run as administrator already, we continue to restart app as administrator
89+ if ( Win32Helper . IsAdministrator ( ) )
90+ {
91+ App . RestartAppAsAdministrator ( ) ;
92+ }
93+ else
94+ {
95+ // Restart requires Squirrel's Update.exe to be present in the parent folder,
96+ // it is only published from the project's release pipeline. When debugging without it,
97+ // the project may not restart or just terminates. This is expected.
98+ UpdateManager . RestartApp ( Constant . ApplicationFileName ) ;
99+ }
92100 }
93101
94102 public void ShowMainWindow ( ) => _mainVM . Show ( ) ;
You can’t perform that action at this time.
0 commit comments