8

简短的

我有一个安装包(基于 MSI),它尝试注册一个 dll 文件以用作 Windows 资源管理器栏(Internet Explorer 工具栏)。

自定义操作定义如下:

[SystemFolder]\regsvr32.exe /s "pathtodllhere"

错误

  • regsvr32 自定义操作在 Windows XP 64 位上不起作用

MSI 日志的输出:

CustomAction SystemFolder_2 返回实际错误代码 5。错误 1722。此 Windows 安装程序包有问题。作为设置的一部分运行的程序未按预期完成。操作 SystemFolder_2,位置:C:\Windows\SysWOW64\,命令:regsvr32.exe /s "C:\Program Files (x86)\Test Install\test.dll"

MSI (s) (10:F4):产品:测试安装 -- 错误 1722。此 Windows 安装程序包有问题。作为设置的一部分运行的程序未按预期完成。操作 SystemFolder_2,位置:C:\Windows\SysWOW64\,命令:regsvr32.exe /s "C:\Program Files (x86)\Test Install\test.dll"

到目前为止,我的测试/想法的简要说明:

  • 自定义操作位于“InstallFinalize”部分,因此仅当文件被拖放到硬盘驱动器时才会运行。
  • dll 文件没有损坏并且是有效的。
  • Regsvr32 自定义操作在 Windows 7 32 位和 Windows XP 32 位上运行良好(和 MSI 安装)。
  • Regsvr32 32 位版本在 64 位安装期间执行(应该如此)。
  • Regsvr32 失败,错误代码为 5,即 ERROR_ACCESS_DENIED。

解决方案和思考

  1. 自注册 - 不使用 regsvr32 并使用我的 MSI 安装程序手动放置注册表项。
  2. 该 dll 是一个 Delphi COM dll,它使用 TRegistry 组件来注册自己。同样,我想不出为什么这不起作用的原因,因为它只是一个包装器,而只是一个想法。

希望我在这里展示了我的研究,不要浪费任何人的时间!

4

1 回答 1

3

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.

Background

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.

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.

于 2012-01-11T16:16:59.677 回答