I have a custom action which during upgrade,removes certain files before installFiles which puts the new files back.What I am noticing is the action is called 2 times. 1.Gets called and deletes the file. 2. InstallFiles copies the new files back. 3.Again gets called and deletes the file.(Should not happen).
My custom action looks like -
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize" />
<Custom Action="NEWER_VERSION_PRESENT" After="FindRelatedProducts">
NEWER_VERSIONS
</Custom>
<Custom Action="DeleteourFiles" Before="InstallFiles"></Custom>
</InstallExecuteSequence>
I read somewhere that for upgrade scenario this custom action gets called twice.I want to know how to prevent it getting called for the second time. basically want my custom action to delete certain files of older version before it puts the new files .What condition should I use?