4

I'm running puppet on windows and I want to upgrade a package (java) I installed using an msi. I installed the package using

package { 'java':
  ensure => installed,
  provider => 'msi',
  source => 'S:\jdk1.6.0_30.msi',
  install_options => { 'INSTALLDIR' => 'C:\tools\java' },
}

Now I want to upgrade to build 31 for example, so I tried running

package { 'java':
  ensure => installed,
  provider => 'msi',
  source => 'S:\jdk1.6.0_31.msi',
  install_options => { 'INSTALLDIR' => 'C:\tools\java' },
}

this does not actually upgrade since the package 'java' is already installed. An when I tried changing the "ensure" value to latest, puppet said that the provider type must have features 'upgradeable'.

Is this just a windows limitation? Is there a way to upgrade the existing Java install using msi packages?

3 Answers 3

3

Is this just a windows limitation?

The MSI provider seems pretty limited relative to the other package providers. This certainly isn't a limitation of Windows/MSI. I believe Windows provides what is needed to make those options work.

Is there a way to upgrade the existing Java install using msi packages?

One option might be to give up on the package msi provider and simply do it all with Exec statements. The msiexec command has lots of options.

You could probably also come up with a way of arranging things so that if an upgrade needs to be done, the old version is purged first. Then a new version is installed, you would probably have to keep track of the version in a file or the registry somewhere, since the MSI providers doesn't give you any information about the version.

2
  • 1
    Looks like the java installer is smart enough to install over an existing version. Still testing that though. Feb 22, 2012 at 16:23
  • 1
    @JeffStorey Yes, you can have mutiple Java versions installed side-by-side. Java MSI packages do not uninstall other versions of JRE. But you can do it yourself. Feb 23, 2012 at 7:01
4

The windows MSI plugin for Puppet isn't capable of understanding versions. Unlike Linux package management systems, there is no metadata catalog reference that Puppet has to look at for what versions are available.

The following is written from mind and untested, but would provide you with a way to enable upgrades. Whenever you get a new version, chain it in. Old versions can be removed from the list when you're sure that everything has been upgraded.

package { 'java':
  ensure => absent,
  provider => 'msi',
  source => 'S:\jdk1.6.0_30.msi',
  install_options => { 'INSTALLDIR' => 'C:\tools\java' },
}

-> #chaining operator forces uninstall before install

package { 'java-1.6.0_31':
  ensure => installed,
  provider => 'msi',
  source => 'S:\jdk1.6.0_31.msi',
  install_options => { 'INSTALLDIR' => 'C:\tools\java' },
}
0

Update: The msi provider has been superseded by the windows provider, which is versionable. Should now work as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .