cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bplivard
Level 4

How to keep some files with major upgrade

Hi all,

I wonder whether anyone has the same requirement with a MSI basic project and could help me out with this one.

Initially, my uninstall procedure removes all files and folders, including those created by the installed product (xml files for instance). The RemoveFile table is extensively populated to that end.

Now, the new requirement would be to retain all files created by the installed product when a major upgrade is applied.

So the trick would be to make the difference between uninstall triggered by a major upgrade and uninstall requested for the whole product.

Has anyone got a hint to how this could be done?

Any help deeply appreciated.

Regards
Labels (1)
0 Kudos
(2) Replies
Barbara
Level 7

See this snippet from the Windows Installer help:

You can condition custom actions that are sequenced after InstallValidate to handle major upgrades by using the UPGRADINGPRODUCTCODE property:

If you want a custom action to run during an uninstallation of the product, but not during the removal of the product by a major upgrade, use this condition.
REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE

If you want a custom action to run only during a major upgrade, use this condition.
UPGRADINGPRODUCTCODE

Hope this helps
Barbara
0 Kudos
bplivard
Level 4

Hello Barbara

Thank you very much for your reply and useful information, which came precisely when I was looking for the right condition (and syntax) to use with my custom action.

Again, thank you a million.

Best regards:)
0 Kudos