mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Remove CreateScheduledTask CA and handle task creation from runner code (#27819)
* Refactor to avoid code duplication * Remove CreateScheduledTask CA * Update installer/PowerToysSetupCustomActions/CustomAction.cpp Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com> * Update installer/PowerToysSetupCustomActions/CustomAction.cpp Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com> --------- Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
This commit is contained in:
@@ -104,7 +104,7 @@ void apply_general_settings(const json::JsonObject& general_configs, bool save)
|
||||
if (is_process_elevated())
|
||||
{
|
||||
delete_auto_start_task_for_this_user();
|
||||
create_auto_start_task_for_this_user(general_configs.GetNamedBoolean(L"run_elevated", false));
|
||||
create_auto_start_task_for_this_user(run_as_elevated);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -127,6 +127,12 @@ void apply_general_settings(const json::JsonObject& general_configs, bool save)
|
||||
delete_auto_start_task_for_this_user();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete_auto_start_task_for_this_user();
|
||||
create_auto_start_task_for_this_user(run_as_elevated);
|
||||
}
|
||||
|
||||
if (json::has(general_configs, L"enabled"))
|
||||
{
|
||||
for (const auto& enabled_element : general_configs.GetNamedObject(L"enabled"))
|
||||
|
||||
Reference in New Issue
Block a user