How to compare registry versions in WiX?

In my wix installer, I want to check the ESRI version of 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 to start with 10, and I tried to fulfill it 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?

+8
wix
source share
1 answer

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

Regarding string comparisons in particular, I would use subscripts supported by the MSI condition syntax . It supports "starts with", "ends with" and "contains", which looks like the best way to determine your value 10. somewhere in the value that you get in the ARC10INSTALLED property.

+10
source share

All Articles