简体   繁体   中英

Ruby chef script .exe file format installer installation

I am creating a ruby chef script (cookbooks recipe) to install Postgresql on my provisioned virtual machine on windows. I have the following scripts:

postgresql_location = "#{Chef::Config['file_cache_path']}/#{node['postgresql']['filename']}"

windows_package 'POSTGRESQL' do
    action :install
    source postgresql_location
    installer_type :custom
end

If I have an installer in .msi format, the installation will work fine. However, if the installer is in .exe format, an exception is thrown.

Is there any missing script or statement that I need to add for it to work? Is there any libraries or built in recipes that I need to be included in my recipe?

Appreciate any help.

Thanks,

You can use Batch resource -

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

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