简体   繁体   English

Chef Windows_package资源具有多个选项

[英]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. 根据厨师文档https://docs.chef.io/resource_windows_package.html提供的文档和示例,有一种方法可以将选项传递给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. 但是,在运行时,它将忽略选项和属性,并且会弹出默认的msi对话框。 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 请提供一个示例,您可以在其中传递一个选项,而公共属性可以在msi文档http://www.advancedinstaller.com/user-guide/msiexec.html中获得。

The Chef source points to MSI installs calling this line for actually performing the installation. Chef源指向MSI安装,请调用此行以实际执行安装。

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. 这应该具有Chef向您显示的相同失败模式,并帮助您进一步发展。

Also, it appears you might need to escape your backslashes in the final c:\\temp\\install.txt . 另外,看来您可能需要在最终的c:\\temp\\install.txt转义反斜杠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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