- Satisfying the Found New Hardware wizard
- Posted by Matt Kane on June 21st, 2005
Hello,
I am working on the driver for a USB printer. Unfortunately the driver is
not certified, and I fear this is part of the problem. The problem is that
every time a user plugs in the printer, or reboots the PC, etc., the Found
New Hardware wizard comes up. Sometimes, going the Found New Hardware wizard
will make everything right. Sometimes, the user ends up with the wizard
coming up constantly no matter what.
I have a postinstall DLL that does some other functions. Is it possible to
do something there to help sort this out? I have tried using
SetupOEMCopyInf() but that did not help. I'm not sure if I messed up the call
or if that's the wrong function to use.
I have SetupAPI logging turned on, but I'm not sure what to look for. When I
plug in the printer, I see some stuff about driver ranks, but nothing I do
seems to change them.
--
Matt Kane
mkb@dirty.org
- Posted by Daniel Whitaker [MSFT] on June 21st, 2005
Greetings,
I'm not suprised about the driver ranks. Those values are used internally
to determine how "signed" a driver is. A driver rank of Zero, means fully
signed and certified. It starts out as zero, then becomes adjusted as
various tests are applied to the various parts of the driver package
(inf,dll's, etc). You can't change the rank results unless you sign your
driver.
Signed or not, you can satisfy the Hardware Wizards searching for a driver
by preinstalling your drivers to a location like:
C:\DRIVERS\DELL\PRINTERS or something similar, then modify the following
registry key to include your drivers location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\DevicePath
You need to append your path to this string. This can be done by your
postinstall DLL.
Once done, Windows will properly find the drivers and perform the proper
SetupCopyInfToOEM functions, even if the printer is plugged into a
different port.
However, the fact that the driver is unsigned will still produce the
unsigned driver warning unless this feature is turned off (System control
panel, Hardware Tab, Driver Signing button).
By the way, this problem most usually happens on development machines
(those which you test and work on). The INF and associated driver files
must be together the FIRST time they are encountered. Otherwise the path
becomes fractured and the install "keeps happening". Usually, a customer
pops in your CD or floppy ONCE, installs, completes and forgets. In a case
such as you describe, placing the printer files on the harddisk and having
the registry point to it will allow Windows to find them again.
Let me know how it works out.
Thanks
Daniel Whitaker
Windows DDK Team
This posting is provided "AS IS" with no warranties, and confers no rights.
- Posted by Matt Kane on June 22nd, 2005
Well, that has the same result. The only difference is that the setupapi log
shows that it tries the new location as well. I guess I'm still not quite
sure what triggers it.
I hacked at this problem once before, and noticed that if I set ConfigFlags
to 0 in the relevant entry under HKEY_LOCAL_MACHINE\SYSTEM\Enum\USBPRINT\
that the wizard doesn't pop up anymore. Is there a proper way to do that or
something similar in a post-installer?
--
Matt Kane
mkb ta dirty tod org
"Daniel Whitaker [MSFT]" wrote:
- Posted by Daniel Whitaker [MSFT] on June 24th, 2005
Greetings,
That's what I suspected. Even though it now finds the files just fine, it
still shows the wizard. This is most likely due to the fact that the
drivers are unsigned. Anytime the serverside install runs into an unsigned
file, setup goes into client side install and thus shows the wizard.
If the hardware wizard keeps coming up, even though the device was
"installed" implies that the installation process did not complete
correctly. So the registry is missing various entries. So PNP keeps
trying to detect and install the drivers again. I would take a close look
at the post DLL you are using.
I'm affraid that the only solution here would be to either get the drivers
signed, or disable the warning via system control panel entirely.
Also, it's a suprise that setting ConfigFlags to zero in
HKEY_LOCAL_MACHINE\SYSTEM\Enum\USBPRINT\
would have any effect at all.
Thanks
Daniel Whitaker
Windows DDK Team
This posting is provided "AS IS" with no warranties, and confers no rights