简体   繁体   中英

Chef windows_package resource with multiple options

Based on the documentation and examples provided by the chef documentation https://docs.chef.io/resource_windows_package.html , there is a way to pass options to an MSI. However, it is not clear on how to pass multiple options and public properties.

I have tried the following:

windows_package 'some msi' do
  action :install
  source "http://some url#{node['some app']['install']['windows']['package']}"
  installer_type :msi
  options "RESTADDRESS=#{node['some app']['rest']['ipaddress']} RESTPORT=#{node['some app']['rest']['port']} /passive /L*V c:\temp\install.txt"
end

However, upon running it ignores the options and properties and the default dialogue for msi pops up. All the examples I have found only use one option in the recipe. Please provide an example where you can pass more that one option and public properties public properties are available in the msi documentation http://www.advancedinstaller.com/user-guide/msiexec.html

The Chef source points to MSI installs calling this line for actually performing the installation.

This means the command becomes:

msiexec /qn /i "http://some url#{node['some app']['install']['windows']['package']}" RESTADDRESS=#{node['some app']['rest']['ipaddress']} RESTPORT=#{node['some app']['rest']['port']} /passive /L*V c:\temp\install.txt

This should have the same failure mode that Chef is showing you, and help you get a little further along.

Also, it appears you might need to escape your backslashes in the final c:\\temp\\install.txt .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM