Skip to content

Commit

Permalink
Merge pull request #45 from elmundio87/windows-package-use-registry
Browse files Browse the repository at this point in the history
find_installed_application.ps1 should search for "Displayname", not "name"
  • Loading branch information
mizzy committed Jan 30, 2014
2 parents 01f71ff + 7e40e0f commit 54c590c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ function FindInstalledApplication
}

if ($appVersion -eq $null) {
$keys | Where-Object {$_.name -like $appName -or $_.PSChildName -like $appName}
@($keys | Where-Object {$_.DisplayName -like $appName -or $_.PSChildName -like $appName}).Length -gt 0
}
else{
$keys | Where-Object {$_.name -like $appName -or $_.PSChildName -like $appName } | Where-Object {$_.DisplayVersion -eq $appVersion}
@($keys | Where-Object {$_.DisplayName -like $appName -or $_.PSChildName -like $appName } | Where-Object {$_.DisplayVersion -eq $appVersion} ).Length -gt 0
}

}

2 changes: 1 addition & 1 deletion lib/specinfra/command/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def check_installed(package, version=nil)
version_selection = version.nil? ? "" : "-appVersion '#{version}'"
Backend::PowerShell::Command.new do
using 'find_installed_application.ps1'
exec "(FindInstalledApplication -appName '#{package}' #{version_selection}) -ne $null"
exec "(FindInstalledApplication -appName '#{package}' #{version_selection}) -eq $true"
end
end

Expand Down

0 comments on commit 54c590c

Please sign in to comment.