问题描述
我有一个安装包(基于MSI),尝试注册一个dll文件用作Windows资源管理器栏(Internet Explorer工具栏).
I have an installation package (MSI based) which attempts to register a dll file for use as a Windows Explorer Bar (Internet Explorer Toolbar).
自定义操作的定义如下:
The custom action is defined as follows:
[SystemFolder]\regsvr32.exe /s "pathtodllhere"
错误
- 在Windows XP 64位上,regsvr32自定义操作不起作用.
- The regsvr32 custom action does not work on Windows XP 64-bit.
- 自定义操作"位于"InstallFinalize"部分中,因此仅在将文件拖放到硬盘驱动器后才运行.
- Dll文件未损坏且有效.
- Regsvr32自定义操作在(Windows 7 32位和Windows XP 32位)上可以正常运行(和MSI安装).
- Regsvr32 32位版本在64位安装期间执行(应如此).
- Regsvr32失败,错误代码为5,即ERROR_ACCESS_DENIED.
- Custom action is in the "InstallFinalize" section, it is therefore run ONLY when the files have been dropped onto the hard drive.
- Dll file is not corrupt and is valid.
- Regsvr32 custom action works fine (and MSI installation) on: Windows 7 32-bit and Windows XP 32-bit.
- Regsvr32 32-bit version is executed during 64-bit install (as it should).
- Regsvr32 fails with error code 5, i.e. ERROR_ACCESS_DENIED.
- 自我注册-不使用regsvr32,而是使用我的MSI安装程序手动放置注册表项.
- 该dll是一个使用TRegistry组件进行自身注册的Delphi COM dll.再说一次,我想不出为什么它不起作用的原因,因为它只是包装器,而只是一种想法.
The error
MSI日志的输出:
MSI(s)(10:F4):产品:测试安装-错误1722.有一个 Windows Installer程序包出现问题.作为程序一部分运行的程序 安装未按预期完成.动作SystemFolder_2,位置: C:\ Windows \ SysWOW64 \,命令:regsvr32.exe/s"C:\ Program Files (x86)\ Test Install \ test.dll"
MSI (s) (10:F4): Product: Test Install -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Action SystemFolder_2, location: C:\Windows\SysWOW64\, command: regsvr32.exe /s "C:\Program Files (x86)\Test Install\test.dll"
到目前为止,我的测试/想法简述如下:
A brief run-down of my tests/thoughts thus-far:
希望我已经在这里展示了我的研究成果,不要浪费任何人的时间!
Hopefully I have shown my research here and don't waste anyone's time!
推荐答案
最佳实践解决方案(如您所提到的)是从组件中提取注册表项,然后使用msi将其写入注册表.
The best practise solution (as you've alluded to) is to extract the registry entries from the component and write them to the registry using the msi.
背景
Regsvr32需要管理员权限和提升权限确认才能在64位Windows 7下注册COM组件,但msiexec不知道请求自定义操作的提升权限.
Regsvr32 requires admin rights and elevated privilege confirmation to register COM components under 64-bit Windows 7 but msiexec doesn't know to request elevated privileges for the custom action.
您可以通过使用打开方式..."在组件上运行C:\ Windows \ SysWOW64 \ regsvr32.exe(这将失败)来测试此要求.而如果您为注册创建一个批处理文件,然后以管理员身份运行",则该组件将成功注册.
You can test this requirement by using "Open with..." to run C:\Windows\SysWOW64\regsvr32.exe on the component (which will fail). Whereas if you create a batch file for the registration and then "Run as Administrator" the component will register successfully.
这篇关于MSI错误-regsvr32自定义操作失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!