1

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.

Yash
  • 214
  • 4
  • 16
  • Were you able to fix this issue? – Makubex Jun 06 '17 at 17:59
  • I created custom action and set condition for the custom action instead as follows (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") Details about property combinations can be found at https://stackoverflow.com/a/731700/3214994 – Yash Jun 10 '17 at 09:25

1 Answers1

1

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.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • Yes, I have used DTF custom actions in WiX project and upgrade from WiX setup to WiX setup works perfectly fine. The problem is when upgrading the product installed by setup created by VS using WiX setup. – Yash Mar 19 '15 at 11:01
  • It did not :( This property works only when product to be upgraded is installed by setup created using WiX. My requirement is to upgrade product installed by vdproj setup. – Yash Mar 24 '15 at 10:22
  • The new Wix-built MSI will set that property in the upgrade when it detects that an older product with the same UpgradeCode is being upgraded.It is irrelevant what MSI product is being upgraded or what it was built with because it's the WiX-built MSI that sets it. If it's not working look elsewhere for the issue, such as the upgrade not happening for some reason. Create a verbose log. – PhilDW Mar 24 '15 at 16:31