I'm creating MSI using Wix Toolset v3.11
I'm using two Custom Actions, a Deferred custom action and it's corresponding Rollback custom action. I'm calling a console application exe file for both the custom actions. If I'm closing the console app cmd window, the rollback custom action gets triggered and it's working fine.
But when I cancel the MSI installation itself, through clicking on Cancel Button of Progress Dialog, the rollback custom action don't trigger.
Here's the sample code:
<CustomAction Id="DoSomething" Execute="deferred" FileKey="abc.exe" ExeCommand="xyz" />
<CustomAction Id="DoSomething_Rollback" Execute="rollback" FileKey="abc.exe" ExeCommand="xyz_rollback" />
<InstallExecuteSequence>
<Custom Action="DoSomething_Rollback" Before="InstallFinalize">TrueCondition</Custom>
<Custom Action="DoSomething" After="DoSomething_Rollback">TrueCondition</Custom>
</InstallExecuteSequence>
I've tried the solution mentioned here - WIX - Run custom action on installation cancellation
When I set the OnExit="Cancel", it starts giving error (DoSomething_Rollback is a custom action whose source is an installed file. It must be sequenced after the CostFinalize action) and project doesn't build.