RegistrySearch 在 Wix 项目中不起作用
我试图在我的安装程序中添加一个检查,这样如果特定的注册表项不存在,它就会失败。这大致就是我正在做的事情:
<Property Id="REGVALUE">
<RegistrySearch Id="regval" Root="HKLM" Key="SOFTWARE\Foo" Type="raw"/>
</Property>
<Condition Message="Valid Foo value not present. Found [REGVALUE]">
<![CDATA[REGVALUE = "Bar" OR REMOVE ~= "ALL"]]>
</Condition>
我遇到的问题是这个条件总是失败。我尝试查询不同的注册表项,无论我尝试什么,我总是得到一个空白值。在安装日志中,我看不到任何对注册表的访问,也看不到任何与注册表相关的错误。所以我有点失落。我错过了一些明显的东西吗?
I'm trying to add a check in my installer, so that if a specific registry key is not present it has to fail. That's roughly what I'm doing:
<Property Id="REGVALUE">
<RegistrySearch Id="regval" Root="HKLM" Key="SOFTWARE\Foo" Type="raw"/>
</Property>
<Condition Message="Valid Foo value not present. Found [REGVALUE]">
<![CDATA[REGVALUE = "Bar" OR REMOVE ~= "ALL"]]>
</Condition>
The problem I'm having is that this condition always fail. I tried querying different registry keys and no matter what I try, I always get a blank value. In the install log I can't see any access to the registry, nor any error related to the registry. So I'm a bit lost. Am I missing something obvious?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现问题了。该问题是安装程序 ui 序列中的操作顺序不正确,导致在运行注册表查询之前检查条件。
Found the problem. The issue was an incorrect ordering of actions in the installer ui sequence, which caused the conditions to be checked before running the registry queries.