15

This question could be considered a duplicate of:

How do I deploy a .inf based driver?

Except that I want to do that entirely in the installer, not with a separate program.

There's supposed to be an example downloadable here: http://msdn.microsoft.com/en-us/library/dd163212.aspx

But there's no download link on that page.

The driver structure is very simple, just an inf and an sys. I've tried this:

  <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>

with the 'wixdifxappextension.dll' and difxapp_x86 both included as references to my project, and the 'driver' tag isn't recognized. If I use 'component' instead of 'driver', then the resulting file isn't actually recognized as a driver, and I have to do a manual installation.

What am I doing wrong here? Or will I have to write yet another program to make this installer work? This is in Wix 3.0.

Community
  • 1
  • 1
mmr
  • 14,781
  • 29
  • 95
  • 145

2 Answers2

12

According to the manual, <Driver> should be under <Component>, and your Wix should look something like:

<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>

More information from this guy's blog

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Shay Erlichmen
  • 31,691
  • 7
  • 68
  • 87
3

I also had the same problem. The following worked for me.

Added to the project 2 references:

  • WixDifxAppExtension
  • difxapp_x64.wixlib

Inside the Wix node of .wxs file, I added the attribute:

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

Looks like it needs to refer and use the difxapp namespace.

Inside the Component that includes the .inf file, I added:

<difxapp:Driver PlugAndPlayPrompt="no"/>
  • `WixDifxAppExtension` and `difxapp_x64.wixlib` could be found in `Program Files (x86)\Wix ToolSet v.3.11\bin` (use Add Reference dialog of Visual Studio) – Mike Keskinov May 27 '22 at 02:33