Driver Install Frameworks (DIFxAPP) |
Microsoft have released some driver related tools at "http://www.microsoft.com/whdc/driver/install/DIFxtls.mspx". Its biggest problem would appear to be that on uninstall of your MSI it removes the driver and unloads any devices that use them...
You may also wish to have a look at the "Device Driver Installation" section in this manual.
The Driver Install Frameworks (DIFxAPP) tools package includes:
If you are installing drivers from other companies you are likely to be automating their existing install process or doing something similar to my "Printer Driver Installation" example.
You may also want to see my "Lack of decent driver support" section as it mentions DIFXAPP issues.
DIFxAPP Error Handling and Logging |
If the DIFxAPP code fails it does not display a dialog, certainly a very undesirable "feature" as the user won't have a clue what the error was (or how to fix it) or worst case not notice it didn't install...
The frameworks do log progress and error messages into verbose logs, these messages begin with with "DIFXAPP:" (for errors try "DIFXAPP: Error").
If you have more than one ".inf" file in a single directory you will see a message like::
DIFXAPP: ERROR more than one driver package found in C:\Drivers\U2S\ DIFXAPP: InstallDriverPackages failed with error 0xD
DIFxAPP Example - Non Perfect |
The following example builds a package and installs the driver. Note that on MSI uninstall it also uninstalls the driver, I don't think this is correct...
Please use the following as a starting point and let me know of any issues or improvements:
;--- Create INSTALLDIR ------------------------------------------------------ <$DirectoryTree Key="INSTALLDIR" Dir="[ProgramFilesFolder]<$ProdInfo.ProductName>" CHANGE="\" PrimaryFolder="Y"> ;--- The driver needs its own feature --------------------------------------- <$Feature "Driver.1" Title=^Driver 1 (hidden)^ Display="0"> ;--- The driver also needs its own installation directory --------------- <$DirectoryTree Key="DRIVER.1.DIR" Dir="[INSTALLDIR]Driver.1"> ;--- The single INF needs to be the keypath of a component -------------- <$Component "Driver.1.inf" Create="Y" Directory_="DRIVER.1.DIR"> ;--- Add the .inf as the keypath of the component ------------------- <$Files "ser2pl.inf" KeyFile="*"> ;--- All valid DIFxAPP flags (see "DIFxAPP.doc") -------------------- const DriverForceInstall = 1 ;;Default is to leave better matching drivers on devices (only works in "quiet" mode?) const NoDriverPlugAndPlayPrompt = 2 ;;Default is to prompt the user for a device if none attached const NoDriverAddRemovePrograms = 4 ;;Default adds 2nd driver specific add-remove entry const DriverLegacy = 8 ;;Default requires driver to be signed const DriverDeleteFiles = 16 ;;Default is not to remove SYSTEM files on uninstall ;--- Install this driver (flags control options, see doco) -------------- <$Table "MsiDriverPackages"> #( ;--- Tell DIFxAPP to installer driver 1 ------------------------- <$Row Component="<$Component?>" ;;The keypath of this component is the driver ".inf" file @Validate="NEW -MISSINGDATA" ;;New row & I haven't bothered defining "_Validation" table entries Flags="DriverLegacy or NoDriverPlugAndPlayPrompt or NoDriverAddRemovePrograms" > #) <$/Table> <$/Component> ;--- Add the rest of the driver files ----------------------------------- <$Component "Driver.1.other" Create="Y" Directory_="DRIVER.1.DIR"> <$Files "ser2pl.sys"> <$Files "pl2303.cat"> <$Files "DRemover98_2K.exe"> <$/Component> <$/Feature> ;--- Include Microsoft's Merge Module (imbeds Custom Actions and binaries) --- #define DIFxAPP_DIR C:\Program Files\Driver Installation Tools 2.01\DIFxApp <$MergeModule "<$DIFxAPP_DIR>\English-US\MergeModule\x86\DIFxApp.msm" Language="1033"> <$MsiValFilter "Value not a member of the set; Table: MsiDriverPackages, Column: Flags, Key(s):"> ;;This is a problem with v2.01, I've reported it and should be fixed in next version
Warning |
I've been told that packages using the DIFxAPP and DPInst tools require a Microsoft WHQL certification or a Microsoft Authenticode and that this requirement probably keeps most companies from being able to use these tools. This no longer appear to be the case...