如何使用WiX部署基于INF的USB驱动程序

时间:2009-07-29 00:40:23

标签: wix driver inf

这个问题可以视为重复:

How do I deploy a .inf based driver?

除了我想在安装程序中完全执行此操作,而不是使用单独的程序。

这里应该有一个可下载的示例: http://msdn.microsoft.com/en-us/library/dd163212.aspx

但该页面上没有下载链接。

驱动程序结构非常简单,只是一个inf和一个sys。我试过这个:

  <Directory Id='SystemFolder' Name='System32'>
    <Directory Id='DriversFolder' Name='Drivers'/>
  </Directory>

...

<DirectoryRef Id="DriversFolder">
  <Driver Id="cyusb" Guid="*">
    <File Id="cyusb.inf" Source="..\Includes\cyusb.inf" />
  </Driver>
  <Driver Id="cyusb_sys" Guid="*">
    <File Id="cyusb.sys" Source="..\Includes\cyusb.sys" />
  </Driver>
</DirectoryRef>

'wixdifxappextension.dll'和difxapp_x86都包含在我的项目的引用中,并且'driver'标记无法识别。如果我使用'component'而不是'driver',那么生成的文件实际上不会被识别为驱动程序,我必须手动安装。

我在这里做错了什么?或者我是否还要编写另一个程序来使这个安装程序工作?这是在Wix 3.0中。

2 个答案:

答案 0 :(得分:10)

根据手册,<Driver>应位于<Component>下,您的Wix应如下所示:

<DirectoryRef Id="DriversFolder" FileSource="..\Includes\">
  <Component Id="MyDriver" Guid="[PUT GUID]">
    <Driver Legacy='yes' />
    <File Id="cyusb.inf" Vital="yes" />
    <File Id="cyusb.sys" Vital="yes" />
  </Component>
</DirectoryRef>

来自this guy's blog

的更多信息

答案 1 :(得分:2)

我也有同样的问题。以下对我有用。

已添加到项目2参考:

  • WixDifxAppExtension
  • difxapp_x64.wixlib

在.wxs文件的Wix节点内,我添加了属性:

xmlns:difxapp='http://schemas.microsoft.com/wix/DifxAppExtension'

看起来它需要引用和使用difxapp名称空间。

在包含Component文件的.inf内,我添加了:

<difxapp:Driver PlugAndPlayPrompt="no"/>
相关问题