Add telemetry event for general settings (#1269)

* telemetry for general settings
This commit is contained in:
Seraphima
2020-02-12 13:03:40 +03:00
committed by GitHub
parent 550d76a447
commit 2bef7631ae
5 changed files with 114 additions and 32 deletions

View File

@@ -34,7 +34,7 @@ void chdir_current_executable()
}
}
int runner()
int runner(bool isProcessElevated)
{
DPIAware::EnableDPIAwarenessForThisProcess();
@@ -79,7 +79,7 @@ int runner()
// Start initial powertoys
start_initial_powertoys();
Trace::EventLaunch(get_product_version());
Trace::EventLaunch(get_product_version(), isProcessElevated);
result = run_message_loop();
}
@@ -115,11 +115,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
auto general_settings = load_general_settings();
int rvalue = 0;
if (is_process_elevated() ||
bool isProcessElevated = is_process_elevated();
if (isProcessElevated ||
general_settings.GetNamedBoolean(L"run_elevated", false) == false ||
strcmp(lpCmdLine, "--dont-elevate") == 0)
{
result = runner();
result = runner(isProcessElevated);
}
else
{