diff --git a/changes/update-installutils-to-allow-for-special-characters-in-registry b/changes/update-installutils-to-allow-for-special-characters-in-registry new file mode 100644 index 0000000000..f3bab1ae9a --- /dev/null +++ b/changes/update-installutils-to-allow-for-special-characters-in-registry @@ -0,0 +1 @@ +- Fixes an issue where special characters in HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall breaks the "installer_utils.ps1 -uninstallOrbit" step in the Windows MSI installer \ No newline at end of file diff --git a/orbit/pkg/packaging/windows_templates.go b/orbit/pkg/packaging/windows_templates.go index a50748bfe9..1c166defb1 100644 --- a/orbit/pkg/packaging/windows_templates.go +++ b/orbit/pkg/packaging/windows_templates.go @@ -571,7 +571,7 @@ function Force-Remove-Orbit { Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" -Recurse -ErrorAction "SilentlyContinue" | Where-Object {($_.ValueCount -gt 0)} | ForEach-Object { # Filter for osquery entries - $properties = Get-ItemProperty $_.PSPath -ErrorAction "SilentlyContinue" | Where-Object {($_.DisplayName -eq "Fleet osquery")} + $properties = Get-ItemProperty -LiteralPath $_.PSPath -ErrorAction "SilentlyContinue" | Where-Object {($_.DisplayName -eq "Fleet osquery")} if ($properties) { #Remove Registry Entries @@ -613,7 +613,7 @@ function Force-Remove-Osquery { Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" -Recurse -ErrorAction "SilentlyContinue" | Where-Object {($_.ValueCount -gt 0)} | ForEach-Object { # Filter for osquery entries - $properties = Get-ItemProperty $_.PSPath -ErrorAction "SilentlyContinue" | Where-Object {($_.DisplayName -eq "osquery")} + $properties = Get-ItemProperty -LiteralPath $_.PSPath -ErrorAction "SilentlyContinue" | Where-Object {($_.DisplayName -eq "osquery")} if ($properties) { #Remove files from osquery location