[runner]Fix non-elevated restart loop (#17853)

This commit is contained in:
Jaime Bernardo
2022-04-21 14:59:29 +01:00
committed by GitHub
parent b463cb11aa
commit d683ab0afd
2 changed files with 4 additions and 5 deletions

View File

@@ -443,10 +443,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
if (is_restart_scheduled())
{
if (!restart_if_scheduled())
{
Logger::warn("Scheduled restart failed. Trying restart as admin as fallback...");
restart_same_elevation();
// If it's not possible to restart non-elevated due to some condition in the user's configuration, user should start PowerToys manually.
Logger::warn("Scheduled restart failed. Couldn't restart non-elevated. PowerToys exits here because retrying it would just mean failing in a loop.");
}
}
stop_tray_icon();