This tutorial on the WIX website worked for me.
To summarize, you should add the UpgradeVersion tag to the Upgrade tag that should be in your product. Then add a custom action and conditionally schedule it - until FindRelatedProducts and testing if a new version is already installed.
The code might look something like this:
<Product ...> <Upgrade Id="YOUR-UPGRADE_GUID"> <UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND" Minimum="{CURRENTVERSION}}" IncludeMinimum="no" /> </Upgrade> <CustomAction Id="NoDowngrade" Error="Error Message" /> <InstallExecuteSequence> <Custom Action="NoDowngrade" After="FindRelatedProducts">NEWERFOUND</Custom> <RemoveExistingProducts Before="InstallInitialize" /> </InstallExecuteSequence> </Product>
Replace CURRENTVERSION with the version number of your product.
sttaq source share