CustomAction DriverPackageInstall 失败,出现 0x80030005

CustomAction DriverPackageInstall failing with 0x80030005

我正在使用 WiX 安装程序通过自定义操作安装 WDF 驱动程序 使用 API DriverPackageInstall。但它因错误“0x80030005”STG_E_ACCESSDENIED 而失败。 我是 运行 作为管理员(假设没有权限问题) 创建了能够成功安装驱动程序的测试 "c" 控制台应用程序。

<InstallExecuteSequence>
     <Custom Action='UninstallDriver'
             After='InstallInitialize'>
                    REMOVE~="ALL" OR REINSTALL</Custom>
 </InstallExecuteSequence>      
  <CustomAction Id='UninstallDriver'
                BinaryKey='install_lib'
                DllEntry='InstallDriver'
                Execute='deferred'
                Impersonate="no"
                Return='check'/>

无法弄清楚为什么会失败 启用完整日志并检查。

MSI (s) (E8:50) [11:56:09:296]: Invoking remote custom action. DLL: C:\Windows\Installer\XXXXXX.tmp, Entrypoint: InstallMyDriver
CustomAction InstallMY.XXXXX_9XX_XXXX_XXXX_XXXXXXXX returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 11:56:10: InstallFinalize. Return value 3.
MSI (s) (E8:38) [11:56:10:144]: Note: 1: 2265 2:  3: -2147287035 
MSI (s) (E8:38) [11:56:10:144]: User policy value 'DisableRollback' is 0
MSI (s) (E8:38) [11:56:10:144]: Machine policy value 'DisableRollback' is 0

已检查的 INF 文件存在于预期的输入位置。

感谢任何帮助。

Similar Answer: WiX silent install unable to launch built in .EXE: WiX v3


Driver element: 为什么不用WiX内置的difx:Driver element / construct?我想知道您是否有系统上下文/模拟问题?通过使用内置的驱动程序元素,您可以获得更多“auto-magic”,因为您可以避免在执行操作时出现的某些常见问题"manually"。

Blast From The Past:这是先前的回答,简要描述了这个元素。不幸的是,我自己无法正确测试它:How do I use WiX to deploy an INF-based USB driver Plus all the start menu shortcuts and desktop icons

Testing:我肯定会尝试这个元素,只需注释掉您现有的自定义操作并尝试一下即可。

<Component>
   <File ... /> 
   <difx:Driver ... />
</Component>