[wix-users] Correct way to patch a CUSTOMACTION conditional

Philip Cheeseman Philip.Cheeseman at nice.com
Tue Sep 1 03:16:41 PDT 2020

We recently replaced our old Installshield installer with a WIX based one with a bootstrapper (Bundle) to handle prerequisites.

I tested upgrading from the various versions of the Installshield installer and all was good. I mistakenly forgot to test upgrading WIX to WIX and therefore got our install custom action conditional wrong. It is:
<Custom Action="UninstallCustomAction" Before="InstallInitialize">REMOVE="ALL"</Custom>

When it should be:
<Custom Action="UninstallCustomAction" Before="InstallInitialize">REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>

This results in some code to clean up installed databases offering to run on upgrade which is risky if the user clicks the wrong option and loses data. What is the correct tech to use to patch this?

I have tried using ORCA to edit the internal MSI but the PCP it generates cannot be parsed by msimsp.exe

(Log extract: ERROR: The .pcp file 'D:\msi\patched.pcp' is invalid.)

I have tried to use a transform but I'm unclear how I target this against the existing msi during the upgrade (Unless I can target against the installing MSI and it passed on but not sure if this is possible in a bundle?).

I have also tried a minor upgrade but that is prevented by our Upgrade code using AllowSameVersionUpgrades=no (We've never done a minor upgrade before):
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="no" DowngradeErrorMessage="Unable to downgrade product" Schedule="afterInstallValidate" />

I'm not sure if I've just missed something with each of these attempts or what I'm trying to do just isn't possible? I just want to make sure I go down the right path rather than keep following the wrong one. I've spent so long googling this one when I can't believe I'm the only person who can have done this.

Thanks in advance.


NICE Systems UK Limited ("NICE") is registered in England under company number, 3403044. The registered office of NICE is at Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.

Confidentiality: This communication and any attachments are intended for the above-named persons only and may be confidential and/or legally privileged. Any opinions expressed in this communication are not necessarily those of NICE. If this communication has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender by e-mail immediately.

Monitoring: NICE may monitor incoming and outgoing e-mails.
Viruses: Although we have taken steps toward ensuring that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.

More information about the wix-users mailing list