Skip to content

Commit b2ae404

Browse files
committed
Support bundle: collect MSI info on Windows
The 2 pieces of information being collected help to investigate any problems with MSI uninstall. See, https://splunk.atlassian.net/browse/SWAT-7073 and https://splunk.atlassian.net/browse/SWAT-7342
1 parent a23ecff commit b2ae404

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

internal/buildscripts/packaging/msi/splunk-support-bundle.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ function createTempDir {
168168
New-Item -Path $TMPDIR/logs -ItemType Directory | Out-Null
169169
New-Item -Path $TMPDIR/logs/td-agent -ItemType Directory | Out-Null
170170
New-Item -Path $TMPDIR/metrics -ItemType Directory | Out-Null
171+
New-Item -Path $TMPDIR/msi -ItemType Directory | Out-Null
171172
New-Item -Path $TMPDIR/zpages -ItemType Directory | Out-Null
172173
# We can not create directory using special characters like : , ?
173174
# So we have encoded it and then created new directory.
@@ -293,6 +294,21 @@ function getMetrics {
293294
}
294295
}
295296

297+
#######################################
298+
# Gather zpages
299+
# - GLOBALS: TMPDIR
300+
# - ARGUMENTS: None
301+
# - OUTPUTS: None
302+
# - RETURN: 0
303+
#######################################
304+
function getMsiInfo {
305+
Write-Output "INFO: Getting MSI information..."
306+
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\*\Products\*\InstallProperties' `
307+
| Where-Object { $_.DisplayName -eq "Splunk OpenTelemetry Collector" } > $TMPDIR/msi/user-installs.txt 2>&1
308+
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' `
309+
| Where-Object { $_.DisplayName -eq "Splunk OpenTelemetry Collector" } > $TMPDIR/msi/uninstall-info.txt 2>&1
310+
}
311+
296312
#######################################
297313
# Gather zpages
298314
# - GLOBALS: TMPDIR
@@ -375,6 +391,7 @@ $(getConfig) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
375391
$(getStatus) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
376392
$(getLogs) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
377393
$(getMetrics) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
394+
$(getMsiInfo) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
378395
$(getZpages) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
379396
$(getHostInfo) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
380397
$(getServiceEnvironment("$TMPDIR/config/service_environment.txt")) 2>&1 `

0 commit comments

Comments
 (0)