Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi experts,

I'm writing a software that communicates with a USB device.
The USB driver is stored during software installation in a subdirectory of the installation path. That path is added to the registry in
HKEY\LocalMachine\Software\Microsoft\Windows\CurrentVersion\DevicePath
e.g.
%SystemRoot%\inf;C:\Programs\MySoftware\UsbDriver


What works:
1) Plugging in the device
2) opening Device Manager
3) selecting the device
4) selecting to update the driver
5) let OS find driver path automatically

What doesn't work:
1) Plug in the device
2) Don't be bothered with anything, driver installs fully automatically

The driver is signed and therefore installs in Windows 8.1, but user will have to manually go to Device Manager.

What's preventing the automatic installation to start right away?

[Edit]
Good news, everyone!
Installation works on Windows 8.1 if the target machine is rebooted after the changes to the registry have been made.
Then, user can plug in its device and the driver is installed smoothly.

On the other side of the coin, there's Windows 7 (x64 Professional).
It, even after rebooting with the registry changes, just pops an error tooltip for a second or two. Driver is not installed.
I know that providing the driver path works since I can start driver installation from Device Manager, select to search for the driver automatically and it works with just one message box asking if I trust the producer.

How's W7 different from W8 that it doesn't install drivers that do work perfectly well in W8?

(I tried with driver packages unsigned, signed with SHA1 and with SHA256)
[/Edit]
Posted
Updated 24-Feb-15 20:50pm
v2

1 solution

Try calling something like this:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 path-to-inf\infname.inf

Check this link for more info:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff557251%28v=vs.85%29.aspx[^]

Good luck!
 
Share this answer
 
Comments
lukeer 25-Feb-15 2:42am    
Although I appreciate this completely different approach, it doesn't work in this case because the .inf file doesn't contain a [DefaultInstall] section.
Thank you anyway.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900