We have a installation scenario where before doing a major upgrade for the product we need tobackup
certain configuration/resource files and later sync them.
So we run a custom action to backup files as :
<InstallExecuteSequence>
..
<Custom Action='BackupAppFolder' Before="RemoveFiles">
<![CDATA[(Installed AND NOT REMOVE="ALL") OR (UPGRADINGPRODUCTCODE)]]>
</Custom>
..
</InstallExecuteSequence>
And Major upgrade is scheduled as
<MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="!(loc.DowngradeMessage)"
Schedule="afterInstallInitialize"/>
'Sync' action is scheduled as
<InstallExecuteSequence>
..
<Custom Action='ResourceSync' Before="InstallFinalize">
(Installed AND NOT REMOVE = "ALL" AND NOT WIX_UPGRADE_DETECTED )
OR (NOT Installed AND WIX_UPGRADE_DETECTED)
</Custom>
..
</InstallExecuteSequence>
I want to schedule the ResourceSync
action such that it runs during
-- Repairs / Patches
-- Second Run of Major Upgrades i.e. install of the new product
-- Minor Upgrades
And not run during
-- uninstall
-- fresh installation
-- First run of major upgrade i.e. uninstall of the existing product
Edit : Problem with above is , it runs in the first phase of major upgrade also.