Archive for October, 2007

WIX 3.0 Driver Install Workaround

This article describes a workaround to install a driver using an existing WIX 3.0 based installer. Unfortunately, at the time of this writing the latest WIX 3.0 build does not support driver installations because the DifXApp.wixlib has not been reworked for WIX 3.0. However, WIX 2.0 supports driver installations quite nicely. The workaround is to create a WIX 2.0 merge module that is included in your WIX 3.0 installer.

1. Create a merge module in WIX 2.0 to install the driver like so:


<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
<Module Id='Example' Guid='PUT-GUID-HERE' Language='1033' Version="1.0.0.0">
<Package Id='PUT-GUID-HERE' Description="Driver Merge Module Example"/>

<Directory Id='TARGETDIR' Name='SourceDir'>
 <Directory Id='INSTALLDIR' Name='Drivers'>
  <Component
   Id="Example Driver Component"
   Guid="PUT-GUID-HERE"
   DriverAddRemovePrograms='yes'
   DriverDeleteFiles='no'
   DriverForceInstall='no'
   DriverLegacy='yes'
   DriverPlugAndPlayPrompt='no'
   DriverSequence='0'>

   <File Id='DRIVERINF' Name='driver.inf' LongName='driver.inf' Source='driver.inf' />
  </Component>
 </Directory>
</Directory>

</Module>
</Wix>

2. Include the merge module in your WIX 3.0 project like so:


<Directory Id='TARGETDIR' Name='SourceDir'>
 <Directory Id='INSTALLDIR' Name='MyApplicationInstallDir' />
  <Merge Id='Driver' Language='1033' SourceFile='Driver.msm' DiskId='1' />
 </Directory>
</Directory>

<Feature Id='MainProgram' Title='Program' Description='The main executable.' Level='1'>
 <MergeRef Id='Driver' />
</Feature>

3. Include the following libraries that contain necessary custom actions to install a driver in your WIX 2.0 lib directory: DifXApp.wixlib, DifXApp.dll, and DifXAppA.dll. These files can be found in the latest WDK (Windows Driver Kit).

4. If you are using Visual Studio 2005 it’s possible to include your WIX 2.0 project with you WIX 3.0 solution. First, create a new merge module project in your solution. Second, manually edit the newly created .wixproj file to have the WIX tool chain point to the WIX 2.0 directory.

There you go. Happy driver installations.

Comments