简体   繁体   English

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

[英]MSI Installer start auto-repair when service starts

I have a WiX based MSI that installs a service and some shortcuts (and lots of other files that don't). 我有一个基于WiX的MSI,可安装服务和一些快捷方式(以及许多其他快捷方式)。

The shortcut is created as described in the WiX docs with a registry key under HKCU as the key file. 按照WiX文档中的描述创建快捷方式,并在HKCU下将注册表项作为密钥文件。 This is an all users install, but to get past ICE38, this registry key has to be under the current user. 这是所有用户的安装,但要通过ICE38,此注册表项必须在当前用户下。

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". 服务启动时(以SYSTEM帐户运行),它会注意到该注册表项无效(至少对该用户有效),然后再次运行安装以“修复”。

In the Event Log I get MsiInstaller Events 1001 and 1004 showing that "The resource 'HKEY_CURRENT_USER\\SOFTWARE\\MyInstaller\\Foo' does not exist." 在事件日志中,我得到MsiInstaller事件1001和1004,显示“资源'HKEY_CURRENT_USER \\ SOFTWARE \\ MyInstaller \\ Foo'不存在”。 This isn't surprising since the SYSTEM user wouldn't have this key. 这并不奇怪,因为SYSTEM用户将没有此密钥。

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

Is there something I can do to disable the auto-repair functionality? 我可以做些什么来禁用自动修复功能? Am I doing something wrong or breaking some MSI rule? 我是在做错什么还是违反了MSI规则? Any hints on where to look next? 关于下一步的任何提示?

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. 通过将服务置于自己的功能中,它将不会扫描其他组件。

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

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. 为了避免看到的自动修复,但仍具有相同的效果, 可以使用ActiveSetup ,它是一个简单的系统,可确保每个用户都有一个程序-通常是配置程序或配置HKCU注册表设置的脚本-只运行一次。

(The first article linked above , something I wrote several years ago, compares the different methods, and if you didn't guess already, favors ActiveSetup...) 上面链接第一篇文章 ,我几年前写的东西,比较了不同的方法,如果您还没有猜到的话,则倾向于ActiveSetup ...)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python服务-Wix MSI安装程序-启动时自动启动无法正常工作 - Python Service - Wix MSI Installer - Auto Start on bootup not working 在MSI安装程序中更新服务名称并重新安装/升级时出错 - Error when updated service name in MSI Installer and Reinstalled/Upgraded 从msi安装程序启动服务,该服务依赖于msi安装的程序集 - Launching a service from msi installer that depends on assemblies installed by the msi 如果应用程序与其他用户一起启动,MSI 安装程序将恢复修改后的安装文件 - MSI Installer revert the modified installation files if application starts with other user 无法使用WiX安装程序启动服务 - Unable to start Service with WiX Installer msi 安装程序中修复选项的用途是什么,它到底有什么作用(内部)? - What is the use of Repair option in a msi installer and what does it really do (internally)? 安装程序启动时可以运行程序吗? - Is it possible to run a program when an installer starts up? MSI安装程序:通过基于服务的安装程序中的CustomAction帮助运行基于UI的EXE - MSI Installer: Help running a UI based EXE with a CustomAction from a service based installer 在 Azure Pipelines 中更改构建映像时,Wix MSI 安装程序失败 - Wix MSI installer fail when changing build image in Azure Pipelines 未安装所选组件时,为什么MSI安装程序成功? - Why does MSI installer succeed when chosen component was not installed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM