永久注册表项 - orca - msi guid

发布于 2024-08-16 07:22:05 字数 683 浏览 3 评论 0原文

使用 .msi 包,我想创建一些注册表项(如果它们不存在),如果存在则保留它们,如果程序被删除则不删除它们。我通过向以下 msi 表添加条目来完成此操作(使用 Orca):Components、FeatureComponents、Registry 和 &锁定权限。我的问题是,我应该如何处理这些键的组件表的 ComponentID 中使用的 GUID?好像有3个选择。

1) 分配它们一次,并在 msi 的未来版本中保留它们

2) 每次生成新版本时分配新的

3) 使用 NULL(根据 http://msdn.microsoft.com/en-us/library/aa368007(VS.85).aspx) 我没试过这个。

其中一个是否比另一个更受青睐?其中一种相对于另一种有什么后果吗? (如果程序被删除,我希望留下尽可能少的东西)。

我也很想知道以下关于永久属性位(16)的注释是什么意思。

如果设置了该位,安装程序在卸载过程中不会删除该组件。 安装程序在 Windows Installer 注册表设置中为该组件注册一个额外的系统客户端。

在哪里可以找到这些条目?

Using a .msi package, I want to create a few registry keys if they don't exist, leave them alone if they do exist, and not delete them if the program is removed. I have done this (using Orca) by adding entries to the following msi tables: Components, FeatureComponents, Registry, & LockPermissions. My question is what should I do about the GUID used in the ComponentID of the Component table for these keys? It seems there are 3 choices.

1) Assign them once and leave them alone in future versions of the msi

2) Assign new ones every time a new version is produced

3) Use NULL (per http://msdn.microsoft.com/en-us/library/aa368007(VS.85).aspx) I have not tried this.

Is one of these to be preferred over the other? Are there any consequences of one over the other? (I'd prefer leaving as little stuff behind as possible if the program is removed).

I am also curious to know what the following comment about the permanent attribute bit (16) means.

If this bit is set, the installer does not remove the component during an uninstall. The installer registers an extra system client for the component in the Windows Installer registry settings.

Where might might these entries be found?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

遇见了你 2024-08-23 07:22:05

来自 Windows Installer MSDN 主题 将应用程序组织成组件

永远不要创建两个组件
安装同名资源
和目标位置。如果一个资源
必须重复多个
组件,更改其名称或目标
在每个组件中的位置。这条规则
应该跨应用程序应用,
产品、产品版本和
公司。

选项(2)将在每次发布新版本时有效地为同一注册表项创建一个新组件,这违反了引用的规则。

选项 (3) 可以在 wix 中通过将组件 GUID 设置为 Guid="" 来完成。它将使 Windows 安装程序安装组件资源,然后“忘记”该组件。这可能会满足您的要求,即不会删除已安装的资源。然而,这也意味着如果注册表项丢失,“修复”将无法恢复。

因此,您应该选择具有固定 GUID 的选项 (1),并设置永久属性以使组件的引用计数保持非零。 Windows 安装程序如何在内部执行此操作是您不应该关心的实现细节,因此我不认为寻找这些 Windows 安装程序注册表设置有什么意义。

From the Windows Installer MSDN topic Organizing Applications into Components:

Never create two components that
install a resource under the same name
and target location. If a resource
must be duplicated in multiple
components, change its name or target
location in each component. This rule
should be applied across applications,
products, product versions, and
companies.

Option (2) would effectively create a new component for the same registry key each time you release a new version, which violates the quoted rule.

Option (3) can be done in wix by setting the component GUID as Guid="". It will make windows installer install the component resources and then "forget" the component. This may do what you want in the sense that the installed resources will not be removed. However, it also means that a "repair" will not be able to restore the registry entries if they go missing.

Therefore you should go for option (1) where you have a fixed GUID, and set the Permanent attribute to keep the reference count for the component non-zero. How windows installer does this internally is an implementation detail that you shouldn't care about, so I don't see the point of looking for those windows installer registry settings.

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