summaryrefslogtreecommitdiff
path: root/lib/chef/platform/query_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/platform/query_helpers.rb')
-rw-r--r--lib/chef/platform/query_helpers.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/chef/platform/query_helpers.rb b/lib/chef/platform/query_helpers.rb
index 9ba8d2261d..dfb99ed750 100644
--- a/lib/chef/platform/query_helpers.rb
+++ b/lib/chef/platform/query_helpers.rb
@@ -58,6 +58,22 @@ class Chef
return nano == 1
end
+ def supports_msi?
+ return false unless windows?
+ require 'win32/registry'
+
+ key = "System\\CurrentControlSet\\Services\\msiserver"
+ access = ::Win32::Registry::KEY_QUERY_VALUE
+
+ begin
+ ::Win32::Registry::HKEY_LOCAL_MACHINE.open(key, access) do |reg|
+ true
+ end
+ rescue ::Win32::Registry::Error
+ false
+ end
+ end
+
def supports_powershell_execution_bypass?(node)
node[:languages] && node[:languages][:powershell] &&
node[:languages][:powershell][:version].to_i >= 3