How to apply a Msi transform at uninstall?

2019-02-25 00:14发布

问题:

I'm trying to fix a Windows Installer based setup that is already released. The fix is for an error that occurs when uninstalling the package. For this I'd like to provide a .mst transform file that is applied before uninstalling. Is it possible to use a transform after the product was installed? Or can the transform be applied to an already installed .msi file before the uninstall is started? The command line I used was like this:

msiexec.exe /x {Product-Code} TRANSFORMS={Path-To}\bugfix.mst

回答1:

Transforms are only applied at first-install, or internally as part of a patch. To fix problems like this, you should consider applying a minor upgrade (although if size is a major concern, you should be able to package the minor upgrade as a patch). Be sure to pass v as part of the REINSTALLMODE property so that the new package replaces the old one; generally vomus is a good value for that property.



回答2:

You can apply a transform after the fact by editing the the HKEY_CLASSES_ROOT\Installer\Products entry for your app.

find your product, add a value called TRANSFORMS and point it to your new transform. Then when the uninstall is kicked off, it will use that transform.



回答3:

Okay. I know this is an old post. But here's something in addition to the above.

Vividos was slightly in luck that bug fix can be applied to an MSI, using REINSTALLMODE=VOMUS wherein the existing cache MSI is 're-cached' with the new installer.

But the 'v' fails if the bug is in the transform applied during MSI installation. The 'v' recaches the MSI but not the transform applied to it.

In such a case the user will have to manually recache the MST from "C:\windows\installer[ProductCodeOfTheMsi]" (using VBScript or other). You will find the old MST here and your BUFIX.MST should have the same name as the old MST in the above location and replace it.

If you want to go through the registry route as how Brian mentioned; change the MST name to your new MST Name with its location.