Hi all, I have a custom action that removes various directories as part of the uninstall process. I want to call this action at different points in the install sequence depending on what's being done:
- During an install, don't run the custom action
- During an upgrade, run the custom action after RemoveExistingProducts
- During an uninstall, run the custom action after RemoveFolders
I can likely get each one of these to work individually, but how do I get them to work together how I want. I tried something like this (some code take from here):
<InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">
NEWERPRODUCTFOUND AND NOT Installed
</Custom>
<LaunchConditions After="AppSearch" />
<RemoveExistingProducts Before="InstallInitialize" />
<!-- NEW _> Clean old files AFTER uninstall during an upgrade -->
<Custom Action="CleanUp" After="RemoveExistingProducts" >
UPGRADINGPRODUCTCODE
</Custom>
<!-- NEW _> Clean old files LAST during an uninstall -->
<Custom Action="CleanUp" After="RemoveFolders" >
(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
</Custom>
</InstallExecuteSequence>
But get a duplicate symbol error when I do a build. Any help will be greatly appreciated!