I'm trying to execute my custom action in wix installer to remove a registry key which was written before in the InstallExecuteSequence before installing a software as follows:
<InstallExecuteSequence>
<Custom Action="RemoveExistingReristryKey" Sequence="150">NOT Installed</Custom>
</InstallExecuteSequence>
When running .msi file, the function RemoveExistingReristryKey was invoked and registry key was deleted and I can see the log:
... Action ended 17:12:59: CostFinalize. Return value 1.
MSI (c) (90:54) [17:12:59:596]: Doing action: RemoveExistingReristryKey Action 17:12:59: RemoveExistingReristryKey. Action start 17:12:59: RemoveExistingReristryKey. MSI (c) (90:E4) [17:12:59:616]: Invoking remote custom action. DLL: C:\Users\CUONG~1.HUY\AppData\Local\Temp\MSIF947.tmp, Entrypoint: _RemoveExistingReristryKey@4 MSI (c) (90:8C) [17:12:59:616]: Cloaking enabled. MSI (c) (90:8C) [17:12:59:616]: Attempting to enable all disabled privileges before calling Install on Server MSI (c) (90:8C) [17:12:59:616]: Connected to service for CA interface. RemoveExistingReristryKey: Deleted registry key of the previous installation. Action ended 17:12:59: RemoveExistingReristryKey. Return value 1.
MSI (c) (90:54) [17:12:59:668]: Doing action: MaintenanceWelcomeDlg ...
However, the error which I want to fix still happens, however, if I remove this registry key manually, the error disappear.
I think maybe my custom action executes too late, so I try to edit by some options of custom action such as: before, after, sequence in the InstallExecuteSequence to execute this custom action immediately and before all of other actions but it's still not, it always executes after standard action "CostFinalize".
How can I execute my custom action immediately when running .msi file to remove registry key?
Thank you so much!