diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/platform/query_helpers.rb | 16 | ||||
-rw-r--r-- | lib/chef/provider/package/windows/msi.rb | 6 |
2 files changed, 6 insertions, 16 deletions
diff --git a/lib/chef/platform/query_helpers.rb b/lib/chef/platform/query_helpers.rb index 169d762a45..477efd1f22 100644 --- a/lib/chef/platform/query_helpers.rb +++ b/lib/chef/platform/query_helpers.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2008-2019, Chef Software Inc. +# Copyright:: Copyright 2008-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,21 +31,11 @@ class Chef false end + # @deprecated we added this method due to Windows Server Nano, which is no longer a platform def supports_msi? return false unless windows? - require "win32/registry" unless defined?(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 + true end # @deprecated we don't support any release of Windows that isn't PS 3+ diff --git a/lib/chef/provider/package/windows/msi.rb b/lib/chef/provider/package/windows/msi.rb index 9efb8fde66..0bf5f64482 100644 --- a/lib/chef/provider/package/windows/msi.rb +++ b/lib/chef/provider/package/windows/msi.rb @@ -1,6 +1,6 @@ # # Author:: Bryan McLellan <btm@loftninjas.org> -# Copyright:: Copyright 2014-2017, Chef Software Inc. +# Copyright:: Copyright 2014-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ # TODO: Allow new_resource.source to be a Product Code as a GUID for uninstall / network install -require_relative "../../../win32/api/installer" if (RUBY_PLATFORM =~ /mswin|mingw32|windows/) && Chef::Platform.supports_msi? +require_relative "../../../win32/api/installer" if RUBY_PLATFORM =~ /mswin|mingw32|windows/ require_relative "../../../mixin/shell_out" class Chef @@ -26,7 +26,7 @@ class Chef class Package class Windows class MSI - include Chef::ReservedNames::Win32::API::Installer if (RUBY_PLATFORM =~ /mswin|mingw32|windows/) && Chef::Platform.supports_msi? + include Chef::ReservedNames::Win32::API::Installer if RUBY_PLATFORM =~ /mswin|mingw32|windows/ include Chef::Mixin::ShellOut def initialize(resource, uninstall_entries) |