3

I am creating a playbook that will install an MSI package on a Windows server, but the win_package module does not respond if the MSI package is already installed. The Ansible documentation says that I can use product_id of an MSI package while installing the package, but the product_id only works if the previously installed package version is the same version as the package I am installing - the Windows server might have a different version of same installer.

How can I uninstall the previous version, and install the current version, using Ansible?

alex
  • 6,818
  • 9
  • 52
  • 103
Amarjit Singh
  • 2,068
  • 19
  • 52

1 Answers1

0

Major Upgrade: A properly authored MSI will uninstall previous versions before it installs the newest by means of a "major upgrade" implemented via the Upgrade table inside the MSI.

Tool: How to implement a major upgrade depends on the tool you use (Installshield, Advanced Installer, WiX, etc...). The link above is from the MSI SDK (in first paragraph above). It shows the real "under the hood - MSI way to do it". In other words the technology itself with no special features from vendor tools to help you make things easy.

Uninstall: The easiest way to manually uninstall an existing MSI is by using an msiexec.exe command line:

msiexec.exe /x {11111111-1111-1111-1111-11111111111X}

Details on how to find existing installations and how to uninstall here:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164