cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
markgreen
Level 3

Uninstall/upgrade error

I have produced a major upgrade to our product. As part of the major upgrade I have entered a row into the upgrade table that will uninstall any older version of the product.

All works fine so far...

However, due to error in our older MSIs, a silent uninstall will cause the INSTALLDIR property to end up without a value. Thus meaning that the uninstall part of the upgrade will fail with a message "Cannot find specified path...."

If I could pass a parameter into the uninstall then I could perhaps gets round this, but I think the uninstall path is pre-stored in the registry. Can anyone think of any other way to get round this?

Otherwise I shall have to result to an entry in the user notes to manually uninstall old versions of the products before uninstalling the new one. People do not always read user notes though and I can see lots of support calls being raised unless I can sort it out!!!

Many thanks for any suggestions...
Labels (1)
0 Kudos
(1) Reply
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The simplest way to resolve this for the existing release would be to perform a "manual" major upgrade. This would basically involve keeping your existing major upgrade item in the Upgrades view, but change the Detect Only option on the upgrade item's Advanced tab to Yes. Then, make a note of the Detect Property name for use later. Create a new EXE custom action (path referencing a directory) with the following parameters:
Working Directory: SystemFolder
Filename & Command Line: msiexec.exe /X {Old_ProductCode}
Install UI Sequence: some point after CostFinalize
Install UI Condition:

This will cause Windows Installer to detect if your old product is installed but will not automatically remove it. The EXE custom action will run the uninstall of the old product if Windows Installer found the previous product (the detect property will be set to a list of related product codes).

There are some downsides to this method:
- If there is more than one previous product, an InstallScript, DLL, or other programmatic type of custom action would be needed to parse through the detect properties list of product codes.
- The old product will not be uninstalled if the new install is run silently (the custom action cannot be in the execute sequence since it runs another MSI install).

Any major upgrades after this point that don't need to compensate for uninstall failures of the older products can use the normal automatic major upgrade method.
0 Kudos