1

I have a strange issue whereby WiX Installer appears to be detecting a SELFFOUND instead of a PREVIOUSFOUND.

I am moving an old InstallAware project over to WiX so I have copied the UpgradeCode from the project to this Product.wxs

    <Upgrade Id='MyGuid'>
  <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND' Minimum='!(bind.FileVersion.MainEXE)' IncludeMinimum='yes' Maximum='!(bind.FileVersion.MainEXE)' IncludeMaximum='yes' />
  <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' Minimum='!(bind.FileVersion.MainEXE)' IncludeMinimum='no' />
  <UpgradeVersion Minimum="1.0.0"
          IncludeMinimum="yes"
          OnlyDetect="no"
          Maximum="!(bind.FileVersion.MainEXE)"
          IncludeMaximum="no"
          Property="PREVIOUSFOUND" />
</Upgrade>

<CustomAction Id='AlreadyUpdated' Error='[ProductName] is already installed.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />

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

and the Upgrade GUID matches that in my Product tag of the UpgradeCode attribute. The product codes between the two versions is different but I don't think making these the same is a good idea.

The version installed by the old InstallAware project is 4.11.7311.0 and is visible in control panel with this version. The version I am trying to install via the Upgrade and remove the old version is 4.11.7314.0.

For some reason whenever I try to run the new WiX .msi it is throwing the [ProductName] is already installed message.

Am I missing something? Because everything seems correct to me. Thanks in advance. Wix Toolset v3.11.

Ryan Thomas
  • 1,724
  • 2
  • 14
  • 27
  • [Have a look here please](https://stackoverflow.com/a/59722068/129130). Can you update with a screen shot from your Upgrade table in the resultant MSI after compilation? By the looks of it you need to take out the UpgradeVersion element that refers to SELFFOUND. – Stein Åsmul Jan 13 '20 at 18:33
  • Thank you for this, this was not a question I found whilst searching. I will check it out and update my question accordingly. – Ryan Thomas Jan 13 '20 at 21:15

1 Answers1

0

Okay, so I found the problem, well there were multiple actually.

Firstly I ran the installer via command prompt to generate a log file.

msiexec /i "C:\Path\To\Installer.msi" /L*V "C:\ProgramData\Install.log"

I then searched this file for

FindRelatedProducts

and it found an application which was setting the SELFFOUND property, now I searched through the registry for the GUID and realised it was an old one from my testing, so I uninstalled this using

msiexec /x {FoundGuid}

Still having the issue at this point though, so repeated the process and found a message that said

FindRelatedProducts: current install is per-machine. Related install for product '{MyGUID}' is per-user. Skipping...

so all I had to do was change my InstallScope from perMachine to perUser and it detects correctly.

Ryan Thomas
  • 1,724
  • 2
  • 14
  • 27
  • I forgot to add the link to this [list of common major upgrade problems](https://stackoverflow.com/questions/56989906/wix-does-not-uninstall-older-version/56991527#56991527). If you have run dark.exe on this to decompile the InstallAware MSI to WiX markup, there could be many constructs that should be eliminated. I would test on virtuals with focus on upgrade scenarios. – Stein Åsmul Jan 14 '20 at 11:02
  • Thanks, will give this a read. My MSI is now behaving as I'd expect, however when placed in a bootstrapper it does not, but I believe this should be a separate question. – Ryan Thomas Jan 14 '20 at 12:36