mirror of
https://github.com/microsoft/PowerToys
synced 2025-09-02 23:45:11 +00:00
Run Settings on same elevation as PowerToys.exe (#9184)
* Run Settings on same elevation as PowerToys.exe * Only apply the fix when running the new Settings
This commit is contained in:
@@ -386,7 +386,11 @@ void run_settings_window()
|
|||||||
executable_args.append(settings_isUserAnAdmin);
|
executable_args.append(settings_isUserAnAdmin);
|
||||||
|
|
||||||
BOOL process_created = false;
|
BOOL process_created = false;
|
||||||
if (is_process_elevated())
|
|
||||||
|
// Due to a bug in .NET, running the Settings process as non-elevated
|
||||||
|
// from an elevated process sometimes results in a crash.
|
||||||
|
// TODO: Revisit this after switching to .NET 5
|
||||||
|
if (is_process_elevated() && !UseNewSettings())
|
||||||
{
|
{
|
||||||
process_created = run_settings_non_elevated(executable_path.c_str(), executable_args.data(), &process_info);
|
process_created = run_settings_non_elevated(executable_path.c_str(), executable_args.data(), &process_info);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user