The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #13104

Detect if newer version of MSI is available for upgrade

Added by Collaboration TR about 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:03/14/2012
Priority:NormalDue date:
Assignee:Josh Cooper% Done:

0%

Category:windows
Target version:2.7.19
Affected Puppet version:2.7.6 Branch:https://github.com/puppetlabs/puppet/pull/851
Keywords:windows package msi

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

  1. Create 2 MSI packages with different version.
  2. Install the first package on target system via puppet.
  3. Install the second package on target system via puppet without uninstalling the first package first Note : We modified the MSI package to automatically uninstall the old version and install the new one on top of the old one right away if the new one has higher version number. This is tested manually and it works.

Expected result – Newer package with higher version number is installed successfully on target system via puppet.

Result – First package is installed successfully on the target system via puppet. – Second(newer) package is NOT installed on the target system via puppet. – Changing init.pp script to use the following line for second package caused error * ensure = >‘[version number]’ or ensure => latest* some error msg was thrown stating that the provider does not support “versionable”

init.pp.bak2 - second package with version 1.0.49 (150 Bytes) Collaboration TR, 03/15/2012 01:42 am

init.pp - first package with version 1.0.48 (150 Bytes) Collaboration TR, 03/15/2012 01:42 am


Related issues

Related to Puppet - Bug #11868: msi package provider can only manage packages it installed Closed 01/10/2012

History

#1 Updated by Josh Cooper about 2 years ago

  • Status changed from Unreviewed to Rejected

Hi there,

Collaboration TR wrote:

  1. Create 2 MSI packages with different version.

Do they have different packagecodes?

  1. Install the first package on target system via puppet.
  2. Install the second package on target system via puppet without uninstalling the first package first Note : We modified the MSI package to automatically uninstall the old version and install the new one on top of the old one right away if the new one has higher version number. This is tested manually and it works.

I’m not sure why you modified the msi to automatically uninstall the old version. It already does that.

  • Second(newer) package is NOT installed on the target system via puppet.

It sounds like you are using the same packagecode for two different MSIs, which will cause Windows Installer to think nothing needs to be done when installing the second MSI. Our build system generates a unique packagecode for each MSI so that this problem doesn’t occur. Also our msi will automatically uninstall the old version, stopping the puppet agent service if needed, reinstall the new version, and start the service back up.

#2 Updated by Collaboration TR about 2 years ago

We have our build script to generate new product and package code every build as shown in Jenkins log below

 [echo] Replacing ProductCode from 8609758C-B32D-4535-AAFE-FA4CE1CB40F4 to FEAD20B4-0B92-4605-BFBD-A40258F95ECE
 [echo] Replacing PackageCode from CA4C3F0A-5BED-4280-9062-48F3E6B420F9 to 3D5982D6-E6DA-4351-95B3-C7686FA30C4A

In addition, I’m attaching 2 init.pp files I used for your review in case I did not use correct syntax.

Also, I tried to use ensure => ‘1.0.49’ in second file instead but got an error msg below

info: Retrieving plugin info: Loading facts in C:/ProgramData/PuppetLabs/puppet/var/lib/facter/facter_dot_d.rb info: Caching catalog for nyci-admws01 err: Failed to apply catalog: Parameter ensure failed: Provider must have features 'versionable' to set 'ensure' to '1.0.49' at /etc/puppetlabs/puppet/modules/adminws/manifests/init.pp:6

#3 Updated by Josh Cooper about 2 years ago

  • Category changed from unknown to windows
  • Status changed from Rejected to Re-opened
  • Assignee set to Josh Cooper
  • Target version set to 3.x
  • Affected Puppet version changed from 2.7.5 to 2.7.6

Sorry, my mistake. This is an issue with the msi package provider. It’s not versionable, so you can’t specify ensure => ‘x.y.z’. It also doesn’t take into account if the package source is different than the one that is currently installed. Really these are outcomes of not querying the registry to determine the state of what is really is installed. See #11868

You should be able to specify the version of the package in the name, e.g. adminws-1.0.49. This is hack, but should resolve the issue for the immediate time.

#4 Updated by Josh Cooper about 2 years ago

  • Status changed from Re-opened to Accepted
  • Target version changed from 3.x to 2.7.x

#5 Updated by Josh Cooper about 2 years ago

  • Keywords set to windows package msi

#6 Updated by Josh Cooper almost 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/851

As part of the MSI package provider changes, puppet can either manage package resources based on their version-specific name, e.g. adminws-1.0.49 or the PackageCode. So I believe this issue will be resolved as part of #11868. So for example, the following should be possible:

package { '{3D5982D6-E6DA-4351-95B3-C7686FA30C4A}':
  ensure => installed,
  source => '...'
}

#7 Updated by Josh Cooper almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version changed from 2.7.x to 2.7.18

#8 Updated by Josh Cooper almost 2 years ago

  • Target version changed from 2.7.18 to 2.7.19

#9 Updated by Moses Mendoza over 1 year ago

  • Status changed from Merged - Pending Release to Closed

Released in 2.7.19rc1.

Also available in: Atom PDF