I'm creating an installer with an exe that needs to be called during first installation only. On any upgrade the custom action shouldn't be called.
<CustomAction Id="MyExe"
Directory="INSTALLFOLDER"
ExeCommand=""[INSTALLFOLDER]MyExe.exe" /arg"
Execute="deferred"
Return="ignore"
Impersonate="no"
/>
and the sequence/condition set as:
<InstallExecuteSequence>
<DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices>
<Custom Action='MyExe' After='InstallFiles' >(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE)</Custom>
</InstallExecuteSequence>
The behaviour I've found is:
- On first install - Action is run
- On upgrade - Action is run <-- I don't want it to run here
- On uninstall - Action is not run
In the MSI installation log I can see an upgradingproductcode is set. I'm not sure how to identify from logs whether it thinks it is installed or not. I tried changing "NOT UPGRADINGPRODUCTCODE" to "UPGRADINGPRODUCTCODE" and then the CA didn't run on upgrade. But it also didn't run on initial installation then.
Am I setting the condition to run on initial installation wrong?
Using Wix 3.11.
1)
a sequence of uninstall of old product and2)
install of a new one - with variations with regards to what order this happens in. Hence one setup is an uninstall and the other one is an install. You can use a debugging approach described here to check conditions. – Stein Åsmul