Install driver without plugging in device - installation

I'm trying to install some unsigned legacy drivers to my computer from command line. I have used dpinst.exe and installhinfsection functions which work fine, however everything I've tried is software first, meaning it installs the driver onto your computer and then doesn't actually show up in the device manager until you plug the device into your computer.
I'm wanting to install the driver and have it show up in the device manager without having to plug in any devices.
I can do this with adding legacy hardware from the device manager, but I want this to be an automated process so all from command line and not having to do it manually through device manager.
thanks in advance
EDIT
The drivers were written by me (UserModeDriverFramework), they are emulating real devices.

Related

Without installing FTDI driver, can an application dependent on it be deployed?

I am developing a Win10 C# application dependent on a third party library, which enables me to control a USB3 device.
By trial and error, I found that I needed to run FTD3XXDriver_WHQLCertified_v1.3.0.4_Installer.exe, which in the end populated the SysWOW64 with FTD3XX.dll and System32\Drivers with FTDIBUS3.sys and the ancillary files and folder.
I would like to run my application from a USB thumb drive on different PC's in my organization without installing any of the drivers. Is there a way to do that?
Bad news: To the best of my knowledge you cannot address an FTDI device if the driver is not installed.
But windows normally install the driver automatically via the windows updater. At least, this is the case for the USB 2 devices of FTDI i.e. 232 family. I do not have a FT60X here to test if the windows updater has a driver ready for this as well.
If the driver is installed via the updater you have to bundle the FTD3XX.DLL with your application as it is not part of the "windows standard" driver. At least this was the case for the FTD2XX.DLL.
Long story short: connect your device to a computer without preinstalled driver. Check if the driver is installed via the windows updater. If this is the case, you mostlikely just need to bundle the FTD3XX.DLL with you application.

Pre-install driver on Windows

I am trying to create an installer (using Inno Setup) that will pre-install a USB driver for an LCD HMI. I have the drivers from the manufacturer (they appear to be signed). However, no matter what I do, Windows will first detect the driver as a "Gadget Serial v2.4" device, then immediately go to "Windows Update" and downloads a "PNX Bulk Device" driver.
This driver does not work with the HMI. I have to then manually open up Device Manager, find the "PNX Bulk Device", go to "Update Driver Software"..."Browse My Computer", "Have Disk", etc.
This is a very arduous process and may be overwhelming for an inexperienced user.
Is there anyway to automate the process, such that if the package is installed before the USB device is plugged in, then the driver will be in place, and Windows will use the correct driver rather than the Generic ones it is finding?
Note: I have tried the DPInst utility, the SetupCopyOEMInf function and pnputil.exe. All methods "appear" to work (ie: no error messages), but Windows still grabs the generic driver first, no matter what.
I realize my understanding of drivers may be flawed. I'm trying this on a Windows 7 x64 architecture, but I would like it to work universally.

Is it possible to fully install a driver when the device is not present?

Is it possible to fully install (and not just pre-install) a device driver on a system before the physical device is plugged in? In particular, I'm looking at the D2XX drivers by FTDI. Their driver installation program effectively runs dpinst.exe, and if you watch the console output of that program it says this:
No matching device was found for 'c:\drivers\ftdiport.inf'. Driver will be installed when plugged in.
The trouble is that I'm also using their .NET library for accessing the device, and that library is funny. It pops up an alert in the constructor if the driver isn't installed. Of course the usual solution is to simply plug in the device and let the driver installation finish as normal, but sometimes this is neglected. The pitfalls with having an unavoidable popup box in a 3rd party library should be obvious.
So does anyone know of a way to automate the full installation, and not just the pre-installation? Are there any dangers to copying the driver to the system folder manually / in advance?
You seem to mention "fully install" by "staging" the driver not by "loading" the driver. You can refer to the source code of "devcon.exe" for dp_add command, which actually do staging the driver package. Staged driver package will be being searched by PnP Manager when the unknown device is detected.

Make driver load automatically when USB device is inserted

I'm using a Limited User account under Windows XP, and I'm having a bit of trouble getting my Adaptoid (the most coveted N64 controller -> USB adapter, because of it's support for sending raw N64 controller commands + the fact that it's been discontinued) to work smoothly: as installed, the included software requires Administrator privileges to load the driver.
Presumably, it is possible to arrange for the driver to be loaded automatically when the Adaptoid is inserted by adding some stuff to the INF file for the driver (wishna1.inf):
the question is, what stuff?
(It would also suit me just as well if the driver could be automatically loaded when anything attempted to open \Device\Wish_NA1, or even to have it automatically loaded at every boot, really, but doing it on insertion seems like the right way.)
Note: I do have access to an administrative account, it's just that I prefer not to have to use it day-to-day.
First of all, let's clarify that a USB device has a Plug & Play driver on Windows 2000 and higher, so services start modes are irrelevant. The driver will have an entry as a "service" in the registry, but its start mode is irrelevant here.
Let's split the problem into two parts:
Installing driver for the device: This requires administrative privileges. This happens when you insert a USB device into a port for the first time. Windows goes over your .INF files to find one that matches your hardware. If the driver is WHQL-certified, it'll load automatically. Otherwise, you'd see the dreaded Add New Hardware wizard. If you're running as admin, a few clicks on Next should be enough to install it. Otherwise, better have that Administrator password ready.
Loading the driver for the device: Once the device is installed, the driver will be loaded each time this device is inserted into this USB port without requiring any additional user intervention. Ever noticed how a USB printer, camera or disk drive load much faster the second time you plug it in? That's because that's just loading, without installing.
From looking at the .INF, it looks valid. Also, it's not WHQL-certified, so you'd have to install it manually.
I'm assuming when you insert the Adaptoid, you get an Add New Hardware wizard. If you point it manually to the installation directory, does the Adaptoid install and function? Does it appear in the Device Manager?
P.S. USB devices which have a serial number are an exception. They're installed once for all USB ports. Those devices are rather uncommon, though.

Forcing Windows to re-scan for drivers

As part of our software's installation, we install drivers for a required 3rd party hardware component. Currently it's up to the user to manually scan for their hardware's drivers once our installation is completed.
Is there an easy way to get Windows to automatically look for the drivers we installed? If so, how does it work? Do we need to tell the OS for which hardware device we have drivers, or just that we have drivers in a certain location? Or can we just install the drivers to System32 folder and trigger a driver rescan?
So the hardware is already plugged in when you install the driver?
Download the Windows Driver Kit (WDK) and see the devcon sample (binary and source included). The "devcon update" command should do what you want (i.e. install the drivers and then load them over the specified device instance).
-scott

Resources