4

I am doing an installation of several products, but because they are built automatically in daily build, they have various GUIDs. They just have same UPGRADE code...

So my question is: Is it possible to know just with UPGRADE code if the product is installed (without using own custom actions)?

I was trying:

    <Property Id="WF_INSTALLED" Value="NOT INSTALLED">
        <ProductSearch Minimum="0" UpgradeCode="{XXXXXXXX-XXXX-XXXX-XXXX-8660911C6596}"/>
    </Property>

But it seems that I cannot use that... Also I find a registry record:

Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\XXXXXXX'

where XXXXXXX is transformed UPGRADE Code, but there are no values under this key so I cannot check for its existence :(

Any help will be appreciated.

EDIT: I am trying to discover if some other product is installed, not that one what I am currently installing.

Dusan Plavak
  • 4,457
  • 4
  • 24
  • 35

1 Answers1

2

You do this using the Upgrade element. See this question: How to implement WiX installer upgrade?

If you only want to detect whether the application is already installed, use the OnlyDetect attribute (Rob's answer has an example of this use).

If you are actually trying to perform an upgrade of your product, the official WiX documentation describes the easiest way to do this.

Community
  • 1
  • 1
Dave Andersen
  • 5,337
  • 3
  • 30
  • 29
  • See my EDIT in question... I am aware that I can do what you posted but it is not what I am looking for... – Dusan Plavak Sep 30 '13 at 08:27
  • 2
    You can detect other products using the `Upgrade` element as well. You just need to use the upgrade code for the other product instead of your own. Just make sure you set `OnlyDetect` so that it doesn't uninstall the other product. You can even check for different versions using the `Minimum` and `Maximum` version attributes. – Dave Andersen Sep 30 '13 at 16:24
  • it looks that your solution works well but when I want to uninstall app then it is not detecting if the app is installed... Hmm do you know if it is possible to detect it also on uninstall, repair or change? thx – Dusan Plavak Oct 15 '13 at 10:34
  • I'm not sure how you would detect on uninstall, since the FindRelatedProducts action doesn't run in the uninstall sequence. Maybe you could store the state of of the app in a reg key or something during install and retrieve it during uninstall. It's hard to say without knowing more about your requirements. – Dave Andersen Oct 15 '13 at 16:53