1
votes

This could be a stupid question.

What we did

We just want to use FindRelatedProducts action to check existing installation's version, by following Wix tutorial:

<Upgrade Id='YOURGUID-7349-453F-94F6-BCB5110BA4FD'>
  <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
    Minimum='1.0.1' IncludeMinimum='yes'
    Maximum='1.0.1' IncludeMaximum='yes' />
  <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
    Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
...
<CustomAction Id='AlreadyUpdated' Error='Foobar 1.0 has already been updated to 1.0.1 or newer.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />

<InstallExecuteSequence>
  <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
  <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
</InstallExecuteSequence>

What we get

  • if no version was installed, FindRelatedProducts can detect that no installation exists, but
  • if 1.0.1 exists, when install 1.0.0, existing installation with higher version number should be detected, and err msg pop up, but it doesn't.

We used Orca to check the installation entry info on .msi files (1.0.0 and 1.0.1), properties of both are correct.

We used msiexec /a foo_1.0.x.msi /l* foo_1.0.x.log to get the log, but found the NEWERFOUND property is NOT set!

What we did wrong?

2

2 Answers

1
votes

Make sure the UpgradeCode is the same for both 1.0.0 package and 1.0.1 package and in Upgrade/@Id attribute.

0
votes

YES, I have try the example from WiX tutorial, replace YOURGUID*** with real GUID, the example doesn't work, I still can install old version over the new version, the downgrade check mechanism seems do not work.