I have a custom action that adds files to the installation directory. When the program is being uninstalled, another custom action tries to remove those files, so that the installation directory can be deleted.
The problem is that my custom uninstallation action runs after the removal of standard install files, so the installation directory is left there, although it's empty.
The config looks similar to this:
<CustomAction Id="AddFilesAction" BinaryKey="installerActions" DllEntry="AddFiles" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CleanupAction" BinaryKey="installerActions" DllEntry="Cleanup" Execute="deferred" Return="check" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="CleanupAction" Before="InstallFiles">Installed</Custom>
<Custom Action="AddFilesAction" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
Can I make the CleanupAction
run before the msi starts removing installation files, so that the custom file is already removed and msi can remove the main installation dir?