如何比较 WiX 中的注册表版本? [英] How do I compare registry versions in WiX?

查看:32
本文介绍了如何比较 WiX 中的注册表版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 wix 安装程序中,我想检查可以通过以下方式找到的 ESRI ArcMap 版本:

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>

我想从 10 开始,我已经尝试使用这个条件来完成它:

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?

推荐答案

RegistrySearch 元素取决于 @Type 属性值,以及注册表中该值的数据类型.因此,如果您将 raw 指定为 Type 属性的值,则您得到的结果很可能包含某个前缀.例如,如果它是 REG_BINARY,您将获得带有 # 前缀的值.您应该在比较操作中考虑这一点.

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.

对于字符串比较,我会使用子字符串运算符 支持MSI 条件语法.它支持 'starts with'、'ends with' 和 'contains',这看起来是在 ARC10INSTALLED 属性中接收到的值中识别值 10. 的最佳方式.

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.

这篇关于如何比较 WiX 中的注册表版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆