mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Start PowerToys Run through the ActionRunner (#12043)
This commit is contained in:
@@ -307,25 +307,17 @@ inline bool run_non_elevated(const std::wstring& file, const std::wstring& param
|
||||
|
||||
inline bool RunNonElevatedEx(const std::wstring& file, const std::wstring& params)
|
||||
{
|
||||
bool failedToStart = false;
|
||||
try
|
||||
{
|
||||
CoInitialize(nullptr);
|
||||
if (!ShellExecuteFromExplorer(file.c_str(), params.c_str()))
|
||||
{
|
||||
failedToStart = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
failedToStart = true;
|
||||
}
|
||||
|
||||
if (failedToStart)
|
||||
{
|
||||
Logger::warn(L"Failed to delegate process creation. Try a fallback");
|
||||
DWORD returnPid;
|
||||
return run_non_elevated(file, params, &returnPid);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user