Uninstall package while installing an other

When installing a MSI package it needs to uninstall an other package.

I created a custom action for uninstalling the package and while running the msi it shows me the message it wants to remove the software, but shortly after that it returns the error another applicatio is already running.

how can i uninstall a package while installing another?

0 Comments   [ + ] Show comments

Answers (4)

Posted by: rpfenninger 14 years ago
Second Degree Green Belt
Hi Marin,

Use the Upgrade table for those tasks.
It is the best if you have the same UpgradeCode within the two packages. Then you can use the VersionMin and VersionMax columns to let Windows Installer detect and remove older packages.

However, if it is a completely different package you want to uninstall during install of a new package, put the UpgradeCode of the application you want to have uninstalled, in the UpgradeCode column of the new package. Fill the ProductCode of the old application in the ActionProperty column and set Attributes to 4, this ignores errors during uninstallation.

Of course this method only works if the old application has been installed as an .msi as well.

Hope this helps


Posted by: MARIN 14 years ago
Orange Senior Belt
Hi Roland,

The 2 packages have to same productcode and upgrade code.
Any idea how to set this into the tables?
Posted by: nheim 14 years ago
10th Degree Black Belt
Hi Dennis,
this should work too. It's intended to work in such a case.
There are 2 other things to get an eye on:
1. You need to add the property you choose in the 'ActionProperty' column, to the property 'SecureCustomProperties' in the property table.
2. Make sure 'RemoveExistingProducts' is called in the 'InstallExecuteSequence' table, before the MSI-Script is executed. A safe way would be to place it right before 'InstallValidate'.

To Roland,
if i read the documentation of the ActionProperty on SDK right, your suggestion with the "ProductCode of the old application in the ActionProperty" is not going to work.
From the SDK:
When the FindRelatedProducts action detects a related product installed on the system, it appends the product code to the property specified in this field. The property specified in this column must be a public property and the package author must add the property to the SecureCustomProperties property. Each row in the Upgrade table must have a unique ActionProperty value. After FindRelatedProducts, the value of this property is a list product codes, separated by semicolons (;), detected on the system.

Regards, Nick
Posted by: YRKUMAR 14 years ago
Senior Yellow Belt
Thanks to "nheim". The below advise worked perfectly for me.

Make sure 'RemoveExistingProducts' is called in the 'InstallExecuteSequence' table, before the MSI-Script is executed. A safe way would be to place it right before 'InstallValidate'.

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ