Reputation: 314
Our current setup project created using vdproj needs to be migrated to WiX. During the process, we are facing problem while upgrading existing vdproj msi to WiX msi. The existing implementation performs some action on 'BeforeUninstall' event of Installer, which should not be called when upgrading, but on using WiX msi, this action is being called. How to skip this event while upgrading using WiX installer?
I have tried setting properties like 'PREVIOUSVERSIONSINSTALLED', 'NEWERPRODUCTFOUND' but still the action is called.
Upvotes: 1
Views: 271
Reputation: 20790
If you're doing a major upgrade in WiX you should be using the MajorUpgrade element. If there is an upgrade going on, it will set the WIX_UPGRADE_DETECTED property as documented here:
http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html
I strongly recommend you get away from the installer class method of running custom action code and look at the DTF managed code custom actions. I don't know that you can call installer classes from WiX anyway, because in VS they depend on infrastructure (the installutilb Dll) that is proprietary to Visual Studio.
Upvotes: 1