Skip to content

Commit

Permalink
(chocolatey-core.extension) Unescape app name pattern when calling 'G…
Browse files Browse the repository at this point in the history
…et-UninstallRegistryKey'

This is needed in some rare cases when there is an actual
need to use a regex pattern when calling 'Get-AppInstallLocation'.
fixes #784
  • Loading branch information
AdmiringWorm committed Mar 21, 2022
1 parent f1d32fb commit fb2073b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions extensions/chocolatey-core.extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.3.6

- 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.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function Get-AppInstallLocation {
$ErrorActionPreference = "SilentlyContinue"

Write-Verbose "Trying local and machine (x32 & x64) Uninstall keys"
$key = Get-UninstallRegistryKey $AppNamePattern | select -First 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
Expand Down

0 comments on commit fb2073b

Please sign in to comment.