如何检测是否安装了SCCM 2012?
我正在编写一个 Wix C++ 自定义操作来检测是否安装了 SCCM 2012。我通过从注册表中读取产品 GUID 来执行此操作:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\
但这在安装 SCCM 2012 的系统上不起作用注册表中没有此类信息。
谁能指出我实现这一目标的正确方向?
我想仅在安装 SCCM 2012 时安装我的软件。
I am writing a Wix C++ Custom Action to detect if SCCM 2012 is installed. I am doing this by reading the product GUID from the registry: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\
But this didn't work as on the system where SCCM 2012 was installed there was no such information in the registry.
Can anyone please point me in the correct direction to achieve this?
I would like to install my software only when SCCM 2012 is installed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为此,您应该利用 Condition 元素。如果将其放置在“产品”或“片段”下,它将作为启动条件。请此处详细了解启动条件。
您将创建的此条件将检查属性。如果您要查找的软件已安装,则应设置该属性,否则不应设置(这是最简单的情况)。为了实现这一点,请编写 RegistrySearch 元素,该元素将在如果找到正确的注册表路径。 RegistrySearch 元素应该是 Property 元素的子元素。
正如您所看到的 - 这里没有自定义操作,这太棒了! :)
You should take advantage of the Condition element for this. If you place it under Product or Fragment, it will work as a launch condition. Learn more about launch conditions here.
This condition you'll author will check a property. The property should be set if the software you're looking for in installed, and not set otherwise (that's the simplest case). In order to achieve this, author the RegistrySearch element, which will define the property in case the proper registry path is found. The RegistrySearch element should be a child of Property element.
As you can see - no custom actions here, and that's great! :)
您不应该依赖未记录的内部结构来检测软件——它们可能会在没有警告的情况下发生变化。 (例如,产品代码 GUID 在升级过程中发生变化,因此除非 SCCM 团队表示不会更改它,否则 SCCM 2012 RTM 甚至 2012 更新的产品代码 GUID 可能会发生变化。)
相反,请查看团队是否记录了一种方法检测它。大多数团队都会记录一个注册表值,用于检测安装的版本等信息。如果没有,您最好还是查看注册表,因为注册表中的值不太可能消失。
You shouldn't rely on undocumented internals for detecting software -- they can change without warning. (For example, the product code GUID changes during upgrades so unless the SCCM team has said they won't change it, it's likely to change for SCCM 2012 RTM and even 2012 updates.)
Instead, see if the team has documented a way of detecting it. Most teams document a registry value for detecting things like which version is installed. If they don't, you're still probably better off looking at the registry, since values there are less likely to go away.