Fix Runner stealing shortcuts on older Win10 (#9744)

This commit is contained in:
Ivan Stošić 2021-02-17 11:36:39 +01:00 committed by GitHub
parent 666b4e5964
commit ee45c39d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,11 +202,18 @@ public:
sei.lpFile = L"modules\\launcher\\PowerLauncher.exe";
sei.nShow = SW_SHOWNORMAL;
sei.lpParameters = executable_args.data();
ShellExecuteExW(&sei);
if (ShellExecuteExW(&sei))
{
m_enabled = true;
m_hProcess = sei.hProcess;
}
else
{
Logger::error("Launcher failed to start");
}
}
else
{
std::wstring action_runner_path = get_module_folderpath();
@ -231,6 +238,7 @@ public:
if (run_non_elevated(action_runner_path, params, pidBuffer))
{
m_enabled = true;
const int maxRetries = 80;
for (int retry = 0; retry < maxRetries; ++retry)
{
@ -248,8 +256,6 @@ public:
}
}
}
m_enabled = true;
}
// Disable the powertoy