基于 INF 的打印机驱动程序的 WIX 安装程序

WIX Installer for a INF based printer Driver

我正在尝试使用 WIX 制作打印机驱动程序的安装程序

我有

我正在考虑使用 INF 来部署驱动程序,但不知道如何实现它。

我也播this Question,(可能重复) 但作为一个初学者,我不能完全理解如何去做。

我需要自己将那些DLL和其他文件复制到相关文件夹并写入注册表吗? 或者他们是否有使用 INF 文件通过 WIX 引擎完成任务的简单方法?如果是,谁能教我应该遵循的步骤?


我试过将所有必要的文件复制到一个文件夹中

  <Component Id="PRNDRV_cat" Guid="{4fba0d21-64bb-458d-9b78-23aed7a39d14}" Directory = "PrinterFolder">
    <difx:Driver Legacy='yes' />
      <File Id="Catalog" Name="sielprndrv.cat" Source="Printer\prndrv.cat" />
      <File Id="DataBase" Name="SIELPRNDRV.gpd" Source="Printer\PRNDRV.gpd" />
      <File Id="Info" Name="SIELPRNDRV.inf" KeyPath="yes" Source="Printer\PRNDRV.inf" />
      <File Id="ini" Name="SIELPRNDRV.ini" Source="Printer\PRNDRV.ini" />
  </Component>

并使用以下命令编译

candle -ext WixDifxAppExtension SielDrivers.wxs
light -ext WixUIExtension -ext WixDifxAppExtension SielDrivers.wixobj difxapp_x64.wixlib -o Setup.msi

安装后,我可以看到它已列在 'Programs and Features' 中,但没有作为打印机添加到 'Devices and Printers' 中。

我错过了什么?

你应该检查 setupapi.dev.logsetupapi.app.log.
您可能知道错误代码。
您可以在 %SystemRoot%\inf.
找到日志 https://docs.microsoft.com/en-us/windows-hardware/drivers/install/setupapi-device-installation-log-entries


在 "Devices and Printers" 中使用 "Add a printer" 按钮是否成功?
如果没有,你应该检查驱动程序包。
您可以复制 Dll 以使用 INF CopyFiles 指令,并可以注册 Dll 以使用 INF RegisterDlls 指令。