summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy HAGE <jha@jsh-consulting.com>2019-10-07 10:24:55 +0200
committerJeremy HAGE <jha@jsh-consulting.com>2019-10-07 11:16:24 +0200
commit851bc0cf4def93cb3506a24d655d4a189cf930a8 (patch)
tree3001d8b4f5c033ab650543bd0ab4b11bc8354d1f
parent63a4af262d777a80c24990368312c2f793eae11c (diff)
downloadchef-851bc0cf4def93cb3506a24d655d4a189cf930a8.tar.gz
Avoid a PATH environment variable update before a windows package install
Signed-off-by: Jeremy HAGE <jha@jsh-consulting.com>
-rw-r--r--lib/chef/provider/package/windows/exe.rb4
-rw-r--r--lib/chef/provider/package/windows/msi.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/provider/package/windows/exe.rb b/lib/chef/provider/package/windows/exe.rb
index 947f66e238..1d9656f7f8 100644
--- a/lib/chef/provider/package/windows/exe.rb
+++ b/lib/chef/provider/package/windows/exe.rb
@@ -64,7 +64,7 @@ class Chef
unattended_flags,
expand_options(new_resource.options),
"& exit %%%%ERRORLEVEL%%%%",
- ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns, sensitive: new_resource.sensitive
+ ].join(" "), default_env: false, timeout: new_resource.timeout, returns: new_resource.returns, sensitive: new_resource.sensitive
)
end
@@ -73,7 +73,7 @@ class Chef
uninstall_entries.select { |entry| [uninstall_version].flatten.include?(entry.display_version) }
.map(&:uninstall_string).uniq.each do |uninstall_string|
logger.trace("Registry provided uninstall string for #{new_resource} is '#{uninstall_string}'")
- shell_out!(uninstall_command(uninstall_string), timeout: new_resource.timeout, returns: new_resource.returns)
+ shell_out!(uninstall_command(uninstall_string), default_env: false, timeout: new_resource.timeout, returns: new_resource.returns)
end
end
diff --git a/lib/chef/provider/package/windows/msi.rb b/lib/chef/provider/package/windows/msi.rb
index 91b3d7a2b2..9efb8fde66 100644
--- a/lib/chef/provider/package/windows/msi.rb
+++ b/lib/chef/provider/package/windows/msi.rb
@@ -70,14 +70,14 @@ class Chef
def install_package
# We could use MsiConfigureProduct here, but we'll start off with msiexec
logger.trace("#{new_resource} installing MSI package '#{new_resource.source}'")
- shell_out!("msiexec /qn /i \"#{new_resource.source}\" #{expand_options(new_resource.options)}", timeout: new_resource.timeout, returns: new_resource.returns)
+ shell_out!("msiexec /qn /i \"#{new_resource.source}\" #{expand_options(new_resource.options)}", default_env: false, timeout: new_resource.timeout, returns: new_resource.returns)
end
def remove_package
# We could use MsiConfigureProduct here, but we'll start off with msiexec
if !new_resource.source.nil? && ::File.exist?(new_resource.source)
logger.trace("#{new_resource} removing MSI package '#{new_resource.source}'")
- shell_out!("msiexec /qn /x \"#{new_resource.source}\" #{expand_options(new_resource.options)}", timeout: new_resource.timeout, returns: new_resource.returns)
+ shell_out!("msiexec /qn /x \"#{new_resource.source}\" #{expand_options(new_resource.options)}", default_env: false, timeout: new_resource.timeout, returns: new_resource.returns)
else
uninstall_version = new_resource.version || installed_version
uninstall_entries.select { |entry| [uninstall_version].flatten.include?(entry.display_version) }
@@ -86,7 +86,7 @@ class Chef
uninstall_string += expand_options(new_resource.options)
uninstall_string += " /q" unless uninstall_string.downcase =~ %r{ /q}
logger.trace("#{new_resource} removing MSI package version using '#{uninstall_string}'")
- shell_out!(uninstall_string, timeout: new_resource.timeout, returns: new_resource.returns)
+ shell_out!(uninstall_string, default_env: false, timeout: new_resource.timeout, returns: new_resource.returns)
end
end
end