I am using wix installer to overwrite(read: modify existing registry values), add new ones etc. Upon uninstall I need to revert them back to their original state (the ones I modified). As this is not supported by Wix and thus I have to use a custom action (as I read) I want to run an exe which will run a .reg file using reg import
. According to this site: http://www.installsite.org/pages/en/isnews/200108/index.htm my custom action has to run After="InstallFinalize"
because the wix rollback would delete my registry import (as part of the rollback).
So essentially it looks like this: Installer modifies reg values, uninstaller deletes all touched registry changes (part of rollback), my exe will restore them.
So I did according to his how to, to start my exe with elevated rights etc. http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html
<Component Id="registry" Guid="*">
<File Id="regexe" Source="RegistryRollback.exe"/>
<File Id="regfile" Source="Reg_rollback.reg" />
</Component>
<Property Id="LaunchRegExe" Value="[#regexe]" />
<CustomAction Id="LaunchRegExe" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
<Custom Action='LaunchRegExe' After='InstallFinalize'>Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
but I get an Error 19 ICE77: LaunchRegExe is a in-script custom action. It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table C:\Merlin\Main\Demo\KioskDemoSetup\nw_setup\nw.wxs 250 1 nw_setup
Thank you for your help!
InstallInitialize
andInstallFinalize
, your action will only be run on an uninstall, which behaves differently when you cancel it. Means that your exe will only run on uninstall, in deferred context, sometime before the (un)installation is finalized. – Issykkul