Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-1522

Windows MSI downgrades will remove files with lower versions, resulting in corrupted installs

    XMLWordPrintable

Details

    • Windows
    • Windows Kanban
    • Needs Assessment
    • Not Needed
    • Needs Assessment

    Description

      Due to the behavior of the MSI installer, MSIs will remove not replace newer versions of files with older versions of the same file, even when downgrading from, for instance, a newer puppet-agent-1.10.7.msi to puppet-agent-1.10.6.msi. MSIs adhere to the versioning rules specified in https://msdn.microsoft.com/en-us/library/aa368599(v=vs.85).aspx

      This behavior makes sense for upgrades, but it's unclear why this happens in downgrade situations (it could be related to how every file gets a new component / guid based on our automated build process). Observationally, Puppet has been found to remove parts of its installation in downgrade scenarios, rendering it unusable - more details in https://tickets.puppetlabs.com/browse/PA-1504?focusedCommentId=481139&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-481139 for a specific example of libeay32.dll being removed.

      There are a number of ways to address this problem as outlined in an MSDN blog post

      1. Re-build the affected files to ensure that they have higher file versions than any previously shipped versions, then re-package version 2 of the MSI with the updated files.
      2. Update the build process for the MSI to ensure that the files in newer builds of the MSI have higher file versions than in any older build of the MSI.
      3. Re-name the affected files and put them into new components in version 2 of the MSI.
      4. Schedule the RemoveExistingProducts action before the costing actions in version 2 of the MSI (as described on Stack Overflow).

      As part of PA-1504, upgrades were fixed by reversioning the built nssm.exe. But the downgrade issue was discovered as a new problem, and none of the above solutions is particularly appealing.

      There is another solution that glenn.sarti has tested, and that seems to work per https://tickets.puppetlabs.com/browse/PA-1504?focusedCommentId=481207&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-481207:

      Adding REINSTALLMODE=dmus as a public property in the MSI also worked. This just sets the default as dmus instead of omus
      Note - This trick only works if the downgrading package has it

      This ticket is about making the default property change and verifying that it works as intended in upgrade / downgrade scenarios. A separate ticket will address the documentation, so that this is noted for end users who downgrade in our installation materials (once this ticket verifies this works).

      Also as part of this work, glenn.sarti and I spot checked the results of a PS script I wrote to extract the list of versioned files from MSIs for all the puppet-agent-*.msi files we've shipped to date. That information is in https://gist.github.com/Iristyle/b6e9fcec5f69f551d4a25fd6cee327f1

      After looking at all the data, we determined that the only point in time that puppet-agent version number increased, but a contained file decreased in version, was for the nssm.exe case in PA-1504.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ethan Ethan Brown
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support