RegistrySearch 在 Wix 项目中不起作用

发布于 2024-09-29 04:48:04 字数 478 浏览 1 评论 0原文

我试图在我的安装程序中添加一个检查,这样如果特定的注册表项不存在,它就会失败。这大致就是我正在做的事情:

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痞味浪人 2024-10-06 04:48:04

发现问题了。该问题是安装程序 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文