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

(chocolatey-core.extension) Unescape app name pattern when calling 'Get-UninstallRegistryKey' #1210

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions extensions/chocolatey-core.extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.3.4
- Bugfix `Get-AppInstallLocation`: Changed key to be forced as a single value (instead of array)
- Bugfix `Get-AppInstallLocation`: Added unescaping of app name pattern when calling 'Get-UninstallRegistryKey' ([#784](https://github.com/chocolatey/chocolatey-coreteampackages/issues/784))

## 1.3.3

- Bugfix `Get-AppInstallLocation`: fix path is directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>chocolatey-core.extension</id>
<version>1.3.3</version>
<version>1.3.4</version>
<title>Chocolatey Core Extensions</title>
<summary>Helper functions extending core choco functionality</summary>
<authors>chocolatey</authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ function Get-AppInstallLocation {
$ErrorActionPreference = "SilentlyContinue"

Write-Verbose "Trying local and machine (x32 & x64) Uninstall keys"
[array] $key = Get-UninstallRegistryKey $AppNamePattern
if ($key.Count -eq 1) {
# Needed to pass in the correct wildcard pattern to 'Get-UninstallRegistryKey'
$unescapedAppNamePattern = [regex]::Unescape($AppNamePattern)
$key = Get-UninstallRegistryKey $unescapedAppNamePattern | select -First 1
if ($key) {
Write-Verbose "Trying Uninstall key property 'InstallLocation'"
$location = $key.InstallLocation
if (is_dir $location) { return strip $location }
Expand Down