[RESOLVED] Windows_package resource multi instance not installing correctly


#1

We are using the package resource within our chef run (example below). We are running this on windows environment and therefore it actually runs windows_package.

package “#{cookbook_name}_#{recipe_name}_application” do
package_name "Application Name (Instance 1)"
source path_to_installer
action :install
end

The issues is when we are deploying multiple instances we change the package_name attribute so that when it looks up in the registry it won’t find the previous instances. For example first run will be “Application name (Instance 1)” second run will be “Application name (Instance 2)”.

The issue is that instance 2 is not getting installed as it says the package and version is already installed. What I think is happening is it is looking up the “source path_to_installer” and matching on that as the msi path are the same.

Is this possible?


#2

MSI installers actually are designed to find earlier installations of the same software. They do that through a GUID installed in the Windows registry.

Kevin Keane
Whom the IT Pros Call
The NetTech
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html


#3

Is there a way to force it to ignore the GUID and to look at the registry DisplayName instead?


#4

Not really; this goes very deep into Windows. It can be done but has to be supported by the software vendor.

There are two other options - both of them are really hacks, and ugly ones at that:

  • You can download a tool called Orca from Microsoft. It is basically an MSI editor that lets you change such things.
  • You can build your own MSI. There is a freeware (I think Open Source, but I’m not sure) tool called MakeMSI.

Kevin Keane
Whom the IT Pros Call
The NetTech
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html