Add version number to telemetry event

use defines from version.h in .rc files and other places.
This commit is contained in:
Enrico Giordani
2019-10-14 19:22:14 +02:00
committed by GitHub
parent eb1ef65fac
commit f9be71eca5
14 changed files with 39 additions and 4 deletions

View File

@@ -68,7 +68,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Start initial powertoys
start_initial_powertoys();
Trace::EventLaunch();
Trace::EventLaunch(get_product_version());
result = run_message_loop();
} catch (std::runtime_error& err) {

Binary file not shown.

View File

@@ -16,10 +16,11 @@ void Trace::UnregisterProvider() {
TraceLoggingUnregister(g_hProvider);
}
void Trace::EventLaunch() {
void Trace::EventLaunch(const std::wstring& versionNumber) {
TraceLoggingWrite(
g_hProvider,
"Runner::Event::Launch",
TraceLoggingWideString(versionNumber.c_str(), "version"),
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));

View File

@@ -4,5 +4,5 @@ class Trace {
public:
static void RegisterProvider();
static void UnregisterProvider();
static void EventLaunch();
static void EventLaunch(const std::wstring& versionNumber);
};

View File

@@ -70,7 +70,8 @@ LRESULT __stdcall tray_icon_window_proc(HWND window, UINT message, WPARAM wparam
case ID_ABOUT_MENU_COMMAND:
if (!about_box_shown) {
about_box_shown = true;
MessageBox(nullptr, L"PowerToys\nVersion 0.11.0\n\xa9 2019 Microsoft Corporation", L"About PowerToys", MB_OK);
std::wstring about_msg = L"PowerToys\nVersion " + get_product_version() + L"\n\xa9 2019 Microsoft Corporation";
MessageBox(nullptr, about_msg.c_str(), L"About PowerToys", MB_OK);
about_box_shown = false;
}
break;