From 778cc0641b9eb26d2327797adebd298ab0e6fea7 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 2 Dec 2025 15:03:54 +0900 Subject: [PATCH 1/3] Update postInstall.ps1 Add an architecture, and fixed a comment on the telemetry section. --- postInstall.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/postInstall.ps1 b/postInstall.ps1 index 92d6608..69f387a 100644 --- a/postInstall.ps1 +++ b/postInstall.ps1 @@ -91,7 +91,7 @@ function Get-DownloadUrl { } # ================================ -# TELEMETRY (ANONYMOUS BY DEFAULT) +# TELEMETRY # ================================ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { @@ -101,6 +101,7 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { } else { # Resolve distinct ID (fallback to machine name) + # A distinct ID uses a unique and anonymous identifier. $finalDistinctId = if ($DistinctId -and $DistinctId.Trim() -ne "") { $DistinctId } else { @@ -110,7 +111,6 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { if ($finalDistinctId -and $finalDistinctId.Trim() -ne "") { # Build single event payload for PostHog /i/v0/e endpoint - # Anonymous event is default: $process_person_profile = false $body = @{ api_key = $TelemetryApiKey event = "app_installed" @@ -208,8 +208,10 @@ function Get-NativeArchitecture { switch ($proc.Architecture) { 0 { $arch = "x86" } # 32-bit Intel/AMD + 5 { $arch = "arm32" } # 32-bit ARM 12 { $arch = "arm64" } # treat ARM as arm64 target 9 { $arch = "x64" } # 64-bit Intel/AMD + 6 { $arch = "ia64" } # Intel Itanium default { $arch = "x86" } # fallback } } From c240f8dfa8ddad9fcb5767733b8b4f4677b34d49 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 2 Dec 2025 15:16:29 +0900 Subject: [PATCH 2/3] Update postInstall.ps1 Improve a distinct ID fallback --- postInstall.ps1 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/postInstall.ps1 b/postInstall.ps1 index 69f387a..e614663 100644 --- a/postInstall.ps1 +++ b/postInstall.ps1 @@ -100,12 +100,25 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { # No-op: continue script } else { - # Resolve distinct ID (fallback to machine name) - # A distinct ID uses a unique and anonymous identifier. + # Resolve distinct ID (fallback to machine name, then device UID) $finalDistinctId = if ($DistinctId -and $DistinctId.Trim() -ne "") { $DistinctId } else { - $env:COMPUTERNAME + # Attempt to get the machine name + $computerName = $env:COMPUTERNAME + + if ($computerName -and $computerName.Trim() -ne "") { + $computerName + } else { + # Fall back to using the device UUID (if COMPUTERNAME is unavailable) + $deviceUid = (Get-WmiObject -Class Win32_ComputerSystemProduct).UUID + if ($deviceUid -and $deviceUid.Trim() -ne "") { + $deviceUid + } else { + # Optionally, generate a new UUID or use a predefined value if UUID is also unavailable + [guid]::NewGuid().ToString() + } + } } if ($finalDistinctId -and $finalDistinctId.Trim() -ne "") { From bf4b2214bceb6ca1940def05a92f289356c0c281 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 2 Dec 2025 15:21:32 +0900 Subject: [PATCH 3/3] Update postInstall.ps1 Remove the architecture numbers comment (duplicated) --- postInstall.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/postInstall.ps1 b/postInstall.ps1 index e614663..b78ed8d 100644 --- a/postInstall.ps1 +++ b/postInstall.ps1 @@ -211,7 +211,6 @@ Write-Host "" # ARCHITECTURE DETECTION # ================================ function Get-NativeArchitecture { - # 0 = x86, 5 = ARM, 9 = x64 # https://learn.microsoft.com/windows/win32/cimwin32prov/win32-processor $arch = $null