Recache MST

Written by Alex Marin · August 28th, 2019

#MST #MSI

Sometimes you might end up in a situation when you cannot uninstall a package. We already covered how you can recache an MSI in our user guide. However, we noticed that this might not work for transforms (MSTs) and a different solution is needed.

Scenario

Let’s say that you have a Custom Action in your MST placed to run at uninstall and crashes. For an MSI you can perform a few simple steps:

  1. Open the package's Advanced Installer project
  2. Fix the problem (for example, remove the execution of the Custom Action)
  3. Build the project
  4. Use this command to recache the MSI:
msiexec /fv < path_to_new_msi >/

After the modified MSI replaces the cached one, you can run the uninstall again.

However, to recache an MST, you must perform some additional steps:

  1. Open the MST in Advanced Installer
  2. Fix the problem (for example, remove the execution of the Custom Action)
  3. Save the MST file
  4. Navigate to HKLM\SOFTWARE\Classes\Installer\Products\YOURPRODUCTID
  5. Change the Transforms key to point to the new location of your MST
  6. Run the uninstall command again.
Registry editor

Note
We have tested the scenario where we replace the MST directly from the caching location (C:\Windows\Installer\{ProductCode}).
However, in that case, the recaching does not work, so the new MST must be placed in a different location, thus the change in the registry that is needed above.

Subscribe to Our Newsletter

Sign up for free and be the first to receive the latest news, videos, exclusive How-Tos, and guides from Advanced Installer.

Comments: