Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I compare registry versions in WiX?

Tags:

wix

In my wix installer, I want to check for a version of ESRI ArcMap which I can find by:

<Property Id="ARC10INSTALLED">
    <RegistrySearch Id="Arc10Search" Root="HKLM" Key="SOFTWARE\ESRI\ArcGIS" Name="RealVersion" Type="raw" />
</Property>

I want starts with 10 and I've tried accomplishing it by using this condition:

<Condition Message="ArcGIS Desktop 10 or 10.1 must be installed"><![CDATA[ARC10INSTALLED AND ARC10INSTALLED >= "10.0.0"]]></Condition>

But that doesn't seem to work, any suggestions?

like image 642
Erik L Avatar asked Feb 03 '23 14:02

Erik L


1 Answers

The value returned by the RegistrySearch element depends on the @Type attribute value, as well as on the data type of that value in the registry. Hence, in case you specify raw as a value of Type attribute, the result you'll get will most likely contain a certain prefix. For instance, if it's REG_BINARY you'll get the value prefixed with #. You should consider this in the operations of comparison.

As for the string comparison in particular, I would use the substring operators supported by the MSI condition syntax. It supports 'starts with', 'ends with' and 'contains', which looks like the best way to identify your value 10. somewhere in the value you receive in ARC10INSTALLED property.

like image 131
Yan Sklyarenko Avatar answered Feb 14 '23 16:02

Yan Sklyarenko