Update postInstall.ps1

Add an architecture, and fixed a comment on the telemetry section.
This commit is contained in:
Namhyeon, Go 2025-12-02 15:03:54 +09:00
parent 046bb146a9
commit 778cc0641b

View File

@ -91,7 +91,7 @@ function Get-DownloadUrl {
} }
# ================================ # ================================
# TELEMETRY (ANONYMOUS BY DEFAULT) # TELEMETRY
# ================================ # ================================
if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") {
@ -101,6 +101,7 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") {
} }
else { else {
# Resolve distinct ID (fallback to machine name) # Resolve distinct ID (fallback to machine name)
# A distinct ID uses a unique and anonymous identifier.
$finalDistinctId = if ($DistinctId -and $DistinctId.Trim() -ne "") { $finalDistinctId = if ($DistinctId -and $DistinctId.Trim() -ne "") {
$DistinctId $DistinctId
} else { } else {
@ -110,7 +111,6 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") {
if ($finalDistinctId -and $finalDistinctId.Trim() -ne "") { if ($finalDistinctId -and $finalDistinctId.Trim() -ne "") {
# Build single event payload for PostHog /i/v0/e endpoint # Build single event payload for PostHog /i/v0/e endpoint
# Anonymous event is default: $process_person_profile = false
$body = @{ $body = @{
api_key = $TelemetryApiKey api_key = $TelemetryApiKey
event = "app_installed" event = "app_installed"
@ -208,8 +208,10 @@ function Get-NativeArchitecture {
switch ($proc.Architecture) { switch ($proc.Architecture) {
0 { $arch = "x86" } # 32-bit Intel/AMD 0 { $arch = "x86" } # 32-bit Intel/AMD
5 { $arch = "arm32" } # 32-bit ARM
12 { $arch = "arm64" } # treat ARM as arm64 target 12 { $arch = "arm64" } # treat ARM as arm64 target
9 { $arch = "x64" } # 64-bit Intel/AMD 9 { $arch = "x64" } # 64-bit Intel/AMD
6 { $arch = "ia64" } # Intel Itanium
default { $arch = "x86" } # fallback default { $arch = "x86" } # fallback
} }
} }