Ruby chef script.exe文件格式安装程序安装

Ruby chef script.exe文件格式安装程序安装,ruby,postgresql,chef-infra,vagrant-windows,Ruby,Postgresql,Chef Infra,Vagrant Windows,我正在创建一个ruby chef脚本(cookbooks recipe),以便在windows上配置的虚拟机上安装Postgresql。我有以下脚本: postgresql_location = "#{Chef::Config['file_cache_path']}/#{node['postgresql']['filename']}" windows_package 'POSTGRESQL' do action :install source postgresql_locati

我正在创建一个ruby chef脚本(cookbooks recipe),以便在windows上配置的虚拟机上安装Postgresql。我有以下脚本:

postgresql_location = "#{Chef::Config['file_cache_path']}/#{node['postgresql']['filename']}" windows_package 'POSTGRESQL' do action :install source postgresql_location installer_type :custom end postgresql_location=“#{Chef::Config['file_cache_path']}/#{node['postgresql']['filename']}” windows\u软件包“POSTGRESQL”do 操作:安装 源postgresql\u位置 安装程序类型:自定义 终止 如果我有一个.msi格式的安装程序,安装将正常工作。但是,如果安装程序是.exe格式,则会引发异常

是否有任何缺少的脚本或语句需要添加才能正常工作?是否有任何库或内置配方需要包含在我的配方中

谢谢你的帮助


谢谢,

您可以使用批处理资源-

batch "Install Setup.exe " do
      code "c:/temp/yourexe.exe"
      action :run      
end

被否决的理由是1)你没有告诉我你用的是哪种版本的厨师。2) 你不是说如果你在跑步列表中包含了windows cookbook 3)你甚至没有显示你得到的例外情况(你是不是希望有占卜技能的人能猜出来并给你答案?)。4) 我高度怀疑您的答案是,或者在阅读中,您应该添加一个守卫,否则资源将尝试在每次运行时运行。我也编辑了你的答案来格式化代码。