Wise Packaging

Use of DpInst for Driver Applications 

07-21-2009 04:38 PM

1.Introduction:

Driver Applications:

Driver applications install some of the information in different file formats. These information files are stored in "%SystemDrive%\Windows\inf" folder. These files are stored by the naming convention as OEMXX.inf and OEMXX.PNF where XX stands for some number eg. OEM05.inf and OEM05.pnf. Each driver application will put its INF and pnf files after the last number of OEM files like when you install driver if the last number of OEM file on the build is OEM05 then your driver will install its information files as OEM06.

So we cannot capture these driver files as they will be hardcoded as OEM number may change from machine to machine.

Different Methods to avoid hard coding of OEMXX files:

We use different techniques like use of setupapi.dll custom action and Difx merge modules to avoid hard coding of OEMXX files. But these methods are very much confusing and time taking though equally effective.

Another method to install driver is with DpInst.exe.

What is DpInst.exe:

Dpinst.exe is nothing but the component of DifX merge module. It identifies the driver files in the folder and installs OEM files automatically with desired number. DpInst stands for "Driver Package Installer".

When directly opened, DpInst.exe runs a wizard-install mode that displays UI welcome dialog, license agreement and then it displays installation page. It performs following steps to install drivers.

  1. DPInst searches the directory where the DPInst executable (DPInst.exe) is located. DPInst also searches vendor-specified subdirectories under the directory where DPInst.exe is located. A vendor specifies the subdirectories by using the search and subdirectory XML elements in an optional DPInst descriptor file (DPInst.xml)
  2. Authenticates the driver packages.(signed or unsigned)
  3. Installs driver packages in the driver store
  4. Adds an Add or Remove Program entry in Control Panel that represents a driver package. (DPInst does not support this feature on Windows Longhorn.)
  5. Installs the driver packages on matching devices that are connected to a computer.

DpInst also provides command line switches as follows:

Switch Function

  1. /U <path to INF file> Uninstall a driver package (INF-file)
  2. /S, /Q Silent mode. Suppresses the Device Installation Wizard and any dialogs popped-up by the operating system.
  3. /LM Accepts unsigned driver packages and packages with missing files. These packages won't install on the latest version of Windows
  4. /P Prompt if the driver package to be installed is not better than the current one.
  5. /F Force install inf the driver package is not better than the current one.
  6. /SH Scans hardware for matching devices and only copies and installs those drivers for which a device is present. Only valid for Plug and Play drivers.
  7. /SA Suppress the Add/Remove Programs entry normally created for each driver package
  8. /A Install all or none.
  9. /PATH <Path> Search for driver packages under the given path
  10. /EL Enables all languages not explicitly listed in the XML file.
  11. /L < LanguageID> Tries to use the given language in all UI. Useful for localization tests.
  12. /SE Suppress the EULA.
  13. /C Dump logging output to attached Console (Windows XP and above)
  14. /D Delete driver binaries on uninstall.
  15. /SW Suppresses the Device Installation Wizard, the OS might still pop-up user dialogs.
  16. /? /H Display Help

2. Packaging with the help of DpInst.exe:

While installing drivers with the help of DpInst, it is needed to be copied to the folder where driver files are present. Then with the help of above mentioned switches we will install drivers. Below steps are to be followed while using DpInst.exe for installing drivers in our captured application (as there would be no hard coded OEM information in vendor MSIs).

Step 1: Search for "*.inf" files in the captured package note down all the folders where INF files are present except windows\inf.

Step 2: Now compare .inf files we got in above step with the .inf files present under "Windows\inf" folder. Make sure all the INF files captured in Windows\inf folder are present in some other folder in your package(wsi)

Step 3: Delete the file "OEMXX.inf" from Windows\inf folder from your package.

Step 4: Copy DPInst.exe in the folder(s) you got in the step 1. (So as to get ease in writing custom action.)

Step 5: Now we will us MSI Script to execute DpInst.exe with appropriate command line switches. Below figures show how to write custom actions

Above steps are to be repeated for different folders where .inf files are present.

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

04-26-2012 01:48 AM

Thanks , Its a Good Article !

06-07-2011 10:35 AM

Hi,

 

I followed the above steps and created msi.  That msi installs well. But, while uninstalation the C:\Window\inf\oemxx.ing files are not removing.  Kindly help me out to solve this issue.

 

Regards,

Ramkumar.

04-07-2010 07:53 PM

Hi, thanks for the great article.

Just downloaded Wise 7. "Execute Program from Destination" looks different from yours, there is no Location tab. I have added rest of stuff. When I click OK button, an error message says "Installation Directory must point to a directory in the installation"...

11-10-2009 02:56 PM

This sounds like it is just mimicking the functionality of the native MS merge Module for DIFx, which I always considered to be very straight forward to use anyway.  http://msdn.microsoft.com/en-us/library/ms791049.aspx

10-26-2009 02:09 PM

nice article , it was very helpful


thanks

07-21-2009 03:51 PM

Very helpful.....

Related Entries and Links

No Related Resource entered.