Search code examples
wixcustom-actionwix3.7

Wix: Run Conditional Custom Action when patching (not full install)


I have a custom action which I want to run ONLY when we apply or rollback an update (not Full install(msi), just a patch (msp)) and not when we install or unintall.

I tried the below code but the custom action is invoked only when I an applying and not when rolling back.

<Custom Action="CheckValidation" Sequence="3710">PATCH OR MsiPatchRemovalList</Custom>

Based on the documentation, "PATCH" and "MsiPatchRemovalList" property should contain guid/s depending on the action.

what am I missing here? What are the possible values in the below cases

![1]: https://i.sstatic.net/P2i35.png

                    |Full Install   |Full Uninstall |Apply Patch    |Rollback Patch
Installed               
REMOVE              
PATCH               
MsiPatchRemovalList             

Solution

  • I figured it out... When you Rollback a patch, custom action of the previous patch is called and not of the one you are rolling back.

    Case: Base build + Update 1 + Update 2 Now if you rollback to Update 1 then then Custom actions of Update 1 will be called and not of Update 2.