1
votes

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.

1
Have a look here please. 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
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

1 Answers

0
votes

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.