服务启动时 MSI 安装程序开始自动修复

发布于 2024-08-28 01:19:59 字数 637 浏览 4 评论 0原文

我有一个基于 WiX 的 MSI,它安装了服务和一些快捷方式(以及许多其他没有安装的文件)。

该快捷方式是按照 WiX 文档中的描述使用 HKCU 下的注册表项创建的作为密钥文件。这是所有用户安装的,但要通过 ICE38,此注册表项必须位于当前用户下。

当服务启动时(它在 SYSTEM 帐户下运行),它会注意到该注册表项无效(至少对于该用户而言),并再次运行安装以“修复”。

在事件日志中,我收到 MsiInstaller 事件 1001 和 1004,显示“资源 'HKEY_CURRENT_USER\SOFTWARE\MyInstaller\Foo' 不存在”。这并不奇怪,因为 SYSTEM 用户没有这个密钥。

我打开了系统范围的 MSI 日志记录,自动修复在 C:\Windows\Temp 文件夹中创建了其日志文件,而不是特定用户的 TEMP 文件夹,这似乎暗示当前用户是 SYSTEM(加上日志文件显示“调用流程”作为我的服务)。

我可以做些什么来禁用自动修复功能吗?我是否做错了什么或违反了某些 MSI 规则?有关下一步该去哪里看的任何提示吗?

I have a WiX based MSI that installs a service and some shortcuts (and lots of other files that don't).

The shortcut is created as described in the WiX docs with a registry key under HKCU as the key file. This is an all users install, but to get past ICE38, this registry key has to be under the current user.

When the service starts (it runs under the SYSTEM account) it notices that that registry key isn't valid (at least of that user) and runs the install again to "repair".

In the Event Log I get MsiInstaller Events 1001 and 1004 showing that "The resource 'HKEY_CURRENT_USER\SOFTWARE\MyInstaller\Foo' does not exist." This isn't surprising since the SYSTEM user wouldn't have this key.

I turned on system wide MSI logging and the auto-repair created its log file in the C:\Windows\Temp folder rather than a specific user's TEMP folder which seems to imply the current user was SYSTEM (plus the log file shows the "Calling process" to be my service).

Is there something I can do to disable the auto-repair functionality? Am I doing something wrong or breaking some MSI rule? Any hints on where to look next?

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

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

发布评论

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

评论(3

只是偏爱你 2024-09-04 01:19:59

将组件拆分为单独的功能。通过将服务放入其自己的功能中,它不会扫描其他组件。

Split the components out into seperate features. By putting the service in it's own feature it won't do a scan for the other components.

云胡 2024-09-04 01:19:59

如果您使用广告快捷方式,则不需要 HKCU 注册表项。

If you use an advertised shortcut you don't need the HKCU registry entry.

帥小哥 2024-09-04 01:19:59

为了避免您看到的自动修复但仍然具有相同的效果,您可以使用 ActiveSetup,这是一个极其简单的确保每个用户都有一个程序(通常是配置 HKCU 注册表设置的配置程序或脚本)的系统仅运行一次。

上面链接的第一篇文章,我几年前写过,比较了不同的方法,如果你还没猜到,我更喜欢 ActiveSetup...)

To avoid the auto-repair you are seeing but still have the same effect, you could use ActiveSetup, which is a dead simple system that ensures each user has a program--usually a configuration program or script that configures the HKCU Registry settings--run exactly once.

(The first article linked above, something I wrote several years ago, compares the different methods, and if you didn't guess already, favors ActiveSetup...)

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