I need to have a driver installed in my customers' computers. Unfortunately, the only way to do this right now is having Windows show its "Hardware Update Wizard" when the device is plugged in, and then have the user do the following:
All of which is slow and unfriendly for a non technically savvy user. For the people who must install the device in many computers, it's a repetitive and annoying process too.
So, I'm trying to write a very simple program that will prompt the user to plug in the device. Then the program will do the same steps above automatically. My questions:
DriverPackageInstall
. Would passing the .inf file as a parameter do what I want? (I'll be writing code to test this in the meanwhile, just give me some time to download the Windows Driver Kit and set up a project...).You did not specify which version of Windows.
On Windows 7 there`s pnputil:
c:\>pnputil -?
Microsoft PnP Utility
Usage:
------
pnputil.exe [-f | -i] [ -? | -a | -d | -e ] <INF name>
Examples:
pnputil.exe -a a:\usbcam\USBCAM.INF -> Add package specified by USBCAM.INF
pnputil.exe -a c:\drivers\*.inf -> Add all packages in c:\drivers\
pnputil.exe -i -a a:\usbcam\USBCAM.INF -> Add and install driver package
pnputil.exe -e -> Enumerate all 3rd party packages
pnputil.exe -d oem0.inf -> Delete package oem0.inf
pnputil.exe -f -d oem0.inf -> Force delete package oem0.inf
pnputil.exe -? -> This usage screen
programmatically, you can use DiInstallDriver
There are several ways and some depend on the type of device you have.
There are several tools for installing driver packages.
DpInst is a complete application which can show a wizard and be customized to install a driver package
DifXApp builds a msi package which can be used to install drivers
DifxApi is the API which DpInst and DifxApp use to install drivers.
Directly using the SetupApi functions.
Here the functions SetupCopyOEMInf and UpdateDriverForPlugAndPlayDevices provide the corresponding entry points for a driver setup. These are contained in the WinSDK.
DpInst/DifxApp/DifxApi are part of the Windows Driver Kit (WDK).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With