PDA

View Full Version : MSI parameters to uninstall old package during major upgrades ?



Adrien
12-14-2015, 08:22 AM
Hi everybody,

During a major upgrade, the MSI engine call the RemoveExistingProducts action to uninstall the old package with the command line:
UPGRADINGPRODUCTCODE={GUID} CLIENTUILEVEL=0 REMOVE=ALL

Is there a way to enhance this command line with some custom MSI parameters?

I'd like to pass a CURRENTDIRECTORY property, which seems not to be initialized in the old package in this context (it generates an error in one of my old custom action...). I have no problem by uninstalling the old package manually (outside major upgrade, CURRENTDIRECTORY property is well defined).

Thanks a lot,

Adrien

Adrien
12-14-2015, 10:41 AM
Hi,

I found a very simple trick by using the "Only Remove Specified Features" setting in the advanced tab of the major upgrade item.

Features listed in this setting are used in the REMOVE property of the RemoveExistingProducts command line quoted above. By the way, if you specify someting like that:

ALL CURRENTDIRECTORY="[CURRENTDIRECTORY]"
The command line to uninstall the old product in the RemoveExistingProducts action becomes the following:
UPGRADINGPRODUCTCODE={GUID} CLIENTUILEVEL=0 REMOVE=ALL CURRENTDIRECTORY="Current directory from your major upgrade"

A bit fishy, but it makes the job!

Another solution could be to call a small upgrade as a prerequisite before starting the major upgrade, as described here (https://community.flexerasoftware.com/archive/index.php?t-184105.html). I haven't tested it, it would have been a little complicated in my case (the previous product had many minor upgrades).

Hope this can help!

Adrien