mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
bootstrapper: add support for silent arg (#5590)
This commit is contained in:
@@ -451,7 +451,7 @@ std::wstring get_process_path(DWORD pid) noexcept
|
||||
return name;
|
||||
}
|
||||
|
||||
bool run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
HANDLE run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
{
|
||||
SHELLEXECUTEINFOW exec_info = { 0 };
|
||||
exec_info.cbSize = sizeof(SHELLEXECUTEINFOW);
|
||||
@@ -464,14 +464,7 @@ bool run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
exec_info.hInstApp = 0;
|
||||
exec_info.nShow = SW_SHOWDEFAULT;
|
||||
|
||||
if (ShellExecuteExW(&exec_info))
|
||||
{
|
||||
return exec_info.hProcess != nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return ShellExecuteExW(&exec_info) ? exec_info.hProcess : nullptr;
|
||||
}
|
||||
|
||||
bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
|
||||
|
||||
@@ -67,7 +67,7 @@ bool is_process_elevated(const bool use_cached_value = true);
|
||||
bool drop_elevated_privileges();
|
||||
|
||||
// Run command as elevated user, returns true if succeeded
|
||||
bool run_elevated(const std::wstring& file, const std::wstring& params);
|
||||
HANDLE run_elevated(const std::wstring& file, const std::wstring& params);
|
||||
|
||||
// Run command as non-elevated user, returns true if succeeded, puts the process id into returnPid if returnPid != NULL
|
||||
bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid);
|
||||
|
||||
Reference in New Issue
Block a user