Windows Installer 卸载服务时出错(无法打开未知密钥)
在卸载我正在开发的安装服务的 VS2010 安装项目时,我收到以下错误(取自详细 MSI 日志记录):
MSI (c) (60:90) [13:37:59:038]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
Error 1402. Could not open key: UNKNOWN\Components\216B73E88467B322BBFF14C949E03D05\F1DB4DDE64042404E8863AB2CA9520DF. System error 5.
Verify that you have sufficient access to that key, or contact your support personnel.
MSI (s) (84:A4) [13:38:01:678]: User policy value 'DisableRollback' is 0
MSI (s) (84:A4) [13:38:01:678]: Machine policy value 'DisableRollback' is 0
Action ended 13:38:01: InstallExecute. Return value 3.
请注意,此服务是使用本地计算机帐户或域用户帐户安装的。它不使用内置帐户,例如网络服务、本地系统或本地服务。
使用 Windows Installer 详细日志分析器 (wilogutl),它告诉我这部分代码是安装程序日志中的第一个错误。此外,它告诉我可能的解决方案:
标准操作或自定义操作 导致失败。
Installer Version: 5.0.7601
Client Side Privilege Details: None
Server Side Privilege Details:
MSI (84:A4) [13:37:55:306]: 产品 {EDD4BD1F-4046-4042-8E68-A32BAC5902FD} 被管理。 MSI (84:A4) [13:37:55:306]:运行产品 '{EDD4BD1F-4046-4042-8E68-A32BAC5902FD}' 具有更高的权限:产品是 已分配。
我尝试运行 ProcMon 来尝试诊断问题,但没有成功。安装程序运行起来似乎没有问题。安装程序使用自定义操作 (C# InstallerClass) 来安装服务。但是系统无法卸载我机器上的服务。
更新1: 以下是日志中人类可读的错误:
(SERVER) MSI (s) (84:A4) [13:38:02:186]: Product: MyService -- Removal failed.
(UNKNOWN)
(SERVER) MSI (s) (84:A4) [13:38:02:186]: Windows Installer removed the product. Product Name: MyService. Product Version: 1.0.0. Product Language: 1033. Manufacturer: ManufacturerName. Removal success or error status: 1603.
(UNKNOWN)
(SERVER) MSI (s) (84:A4) [13:38:02:187]: Deferring clean up of packages/files, if any exist
(SERVER) MSI (s) (84:A4) [13:38:02:187]: MainEngineThread is returning 1603
错误 1603 可以解释为以下内容(尽管日志中未显示):
文件[2][3]正在使用中 通过以下过程:名称:[4], ID:[5],窗口标题:“[6]”
While uninstalling a VS2010 setup project I'm developing which installs a service, I am receiving the following error (taken from the verbose MSI logging):
MSI (c) (60:90) [13:37:59:038]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
Error 1402. Could not open key: UNKNOWN\Components\216B73E88467B322BBFF14C949E03D05\F1DB4DDE64042404E8863AB2CA9520DF. System error 5.
Verify that you have sufficient access to that key, or contact your support personnel.
MSI (s) (84:A4) [13:38:01:678]: User policy value 'DisableRollback' is 0
MSI (s) (84:A4) [13:38:01:678]: Machine policy value 'DisableRollback' is 0
Action ended 13:38:01: InstallExecute. Return value 3.
Note that this service is installed using a local machine account or a domain user account. It DOES NOT use the built-in account such as Network Service, Local System, or Local Service.
Using the Windows Installer Verbose Log Analyzer (wilogutl), it tells me that this section of code is the first error from the installer log. Furthermore, it tells me the possible solutions:
A standard action or custom action
caused the failure.
Installer Version: 5.0.7601
Client Side Privilege Details: None
Server Side Privilege Details:
MSI (s) (84:A4) [13:37:55:306]:
Product
{EDD4BD1F-4046-4042-8E68-A32BAC5902FD}
is managed. MSI (s) (84:A4)
[13:37:55:306]: Running product
'{EDD4BD1F-4046-4042-8E68-A32BAC5902FD}'
with elevated privileges: Product is
assigned.
I've tried running ProcMon to try and diagnose the problem but no luck. The installer seems to run no problem. The installer uses a custom action (C# InstallerClass) to install the service. The system cannot uninstall the service on my machine however.
Update 1:
Here is the human-readable error from the logs:
(SERVER) MSI (s) (84:A4) [13:38:02:186]: Product: MyService -- Removal failed.
(UNKNOWN)
(SERVER) MSI (s) (84:A4) [13:38:02:186]: Windows Installer removed the product. Product Name: MyService. Product Version: 1.0.0. Product Language: 1033. Manufacturer: ManufacturerName. Removal success or error status: 1603.
(UNKNOWN)
(SERVER) MSI (s) (84:A4) [13:38:02:187]: Deferring clean up of packages/files, if any exist
(SERVER) MSI (s) (84:A4) [13:38:02:187]: MainEngineThread is returning 1603
And the error 1603 can be interpreted as the following (although this is not shown in the log):
The file [2][3] is being held in use
by the following process: Name: [4],
Id: [5], Window Title: '[6]'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我从另一位开发人员那里得到了一些帮助,问题是用于安装该软件的用户帐户是一个域用户帐户,该帐户有权创建注册表项,但无权在卸载过程中删除它们。
此过程在注册表中留下了许多键,导致卸载/重新安装时出现问题。
解决方案是将我自己添加为“计算机管理”下的本地用户帐户。接下来,我必须将此用户分配给“用户和管理员”组(只是为了更好地衡量)。最后,我不得不进入注册表,找到所有残留的软件注册表项并强行删除它们。
这并非易事,因为当您右键单击并选择键值的权限时,删除键的过程涉及大约六个步骤:
Okay, I got some assistance from another developer and the problem turned out to be that the user account used to install the software was a Domain User account which had access to create registry keys but not the permissions to delete them during the uninstall.
This process left a lot of keys in the registry that cause problems on uninstall/reinstall.
The solution was to add myself as a local user account under Computer Management. Next I had to assign this user to the Users and Administrators group (just for good measure). Finally, I had to go into the registry and find all remnants of the software registry keys and forcibly delete them.
This was no easy feat because the process of deleting a key involved about six steps when you right-click and select Permissions on a key value: