Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(script): Escape square brackets in registry key paths #1691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ try {
| % { $_.Name.TrimStart("HKEY_LOCAL_MACHINE\") }

$allKeys = $baseKeys + $wowKeys

$uninstallIds = New-Object System.Collections.ArrayList
foreach ($key in $allKeys) {
$keyData = Get-Item -Path HKLM:\$key
$escapedKey = $key -replace '\[', '`[' -replace '\]', '`]'
$keyData = Get-Item -Path "HKLM:\$escapedKey"
$name = $keyData.GetValue("DisplayName")
if ($name -and $name -match $Match) {
$keyId = Split-Path $key -Leaf
Expand All @@ -67,8 +68,7 @@ try {
}
}
} catch {
Write-Host -ForegroundColor Red "We detected you may be running an anti-virus software preventing our installation to continue. Please check your anti-virus software to allow Powershell execution while running this installation."
exit 1;
throw $_.Exception
}

msiexec.exe /qn /i $env:TEMP\NewRelicCLIInstaller.msi | Out-Null;
msiexec.exe /qn /i $env:TEMP\NewRelicCLIInstaller.msi | Out-Null;
Loading