mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Continue to restart app as administrator if app is run as administrator already
This commit is contained in:
parent
ca6f077e63
commit
ba1ada7bf1
1 changed files with 12 additions and 4 deletions
|
|
@ -85,10 +85,18 @@ namespace Flow.Launcher
|
|||
// Wait for all image caches to be saved before restarting
|
||||
await ImageLoader.WaitSaveAsync();
|
||||
|
||||
// Restart requires Squirrel's Update.exe to be present in the parent folder,
|
||||
// it is only published from the project's release pipeline. When debugging without it,
|
||||
// the project may not restart or just terminates. This is expected.
|
||||
UpdateManager.RestartApp(Constant.ApplicationFileName);
|
||||
// If app is run as administrator already, we continue to restart app as administrator
|
||||
if (Win32Helper.IsAdministrator())
|
||||
{
|
||||
App.RestartAppAsAdministrator();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Restart requires Squirrel's Update.exe to be present in the parent folder,
|
||||
// it is only published from the project's release pipeline. When debugging without it,
|
||||
// the project may not restart or just terminates. This is expected.
|
||||
UpdateManager.RestartApp(Constant.ApplicationFileName);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowMainWindow() => _mainVM.Show();
|
||||
|
|
|
|||
Loading…
Reference in a new issue