How to get rid of those "delightful" "found new hardware" dialogs.

Hi folks,

Been working on my installation program recently, and almost all is well
apart from one *really annoying* feature. The main device I have acts as
a bus driver, and creates several (about 10) child devices.

Initially, when the hardware is added, and the machine booted, a “found
new hardware” dialog pop up (no surprise there). It’s then possible to
cancel this dialog, and at a later convenient moment, run my install
app. The install app installs the driver for the main device, which
starts up, and then creates all the child devices.

What then happens is that a “found new hardware” dialog pops up for the
first child device, asking if I’d like to search for drivers online.
This is very irritating, as the install app is in the process of
installing the drivers for the child devices.

I’ve tried to get rid of it, but there’s a catch-22: If I install the
drivers for the child devices *after* the main device, then the dialog
pops up, & if you leave it alone, it subsequently goes away as the
install app installs the child drivers. If I install the drivers for the
child devices *beforehand* the annoying dialog *still* pops up.

What’s even more annoying is that it’s possible for the user to then
respond to these popped up dialogs, at which point, my install app and
the user mode PnP manager seem to have a bit of a race to see who can
“install” something appropriate first. NOT what I want!

This seems to happen just under XP service pack 2 - earlier OS’s (2k for
example) would simply allow the install app to complete, and the next
time time PnP dev tree was rescanned (either next reboot, or explicitly
by the install app), they’d just raise a couple of dialogs indicating
things were being installed, and hey-presto, it all worked!

So basically:

  • The install looks unprofessional.
  • The dialogs raised let the user faff with what should be a smooth
    install process.

This is one situation where I feel that the security considerations of
SP2 seem to have made things distinctly worse (if theoretically more
secure) from the users P.O.V.

How do I sort this?

MH.

This email and any attachments is confidential, may be legally privileged and is intended for the use of the addressee only. If you are not the intended recipient, please note that any use, disclosure, printing or copying of this email is strictly prohibited and may be unlawful. If received in error, please delete this email and any attachments and confirm this to the sender.

To get rid of * ALL * the boxes you would need to sign your driver/s.

Don’t think there’s much you can do for the other situations.

How are you installing you devices from your installation? Via
SetupOEMCopyInf etc or…?

BR,

Rob Linegar
Software Engineer
Data Encryption Systems Limited
www.des.co.uk | www.deslock.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin C Harvey
Sent: 06 January 2005 15:43
To: Windows System Software Devs Interest List
Subject: [ntdev] How to get rid of those “delightful” “found new
hardware” dialogs.

Hi folks,

Been working on my installation program recently, and almost all is well
apart from one *really annoying* feature. The main device I have acts as
a bus driver, and creates several (about 10) child devices.

Initially, when the hardware is added, and the machine booted, a “found
new hardware” dialog pop up (no surprise there). It’s then possible to
cancel this dialog, and at a later convenient moment, run my install
app. The install app installs the driver for the main device, which
starts up, and then creates all the child devices.

What then happens is that a “found new hardware” dialog pops up for the
first child device, asking if I’d like to search for drivers online.
This is very irritating, as the install app is in the process of
installing the drivers for the child devices.

I’ve tried to get rid of it, but there’s a catch-22: If I install the
drivers for the child devices *after* the main device, then the dialog
pops up, & if you leave it alone, it subsequently goes away as the
install app installs the child drivers. If I install the drivers for the
child devices *beforehand* the annoying dialog *still* pops up.

What’s even more annoying is that it’s possible for the user to then
respond to these popped up dialogs, at which point, my install app and
the user mode PnP manager seem to have a bit of a race to see who can
“install” something appropriate first. NOT what I want!

This seems to happen just under XP service pack 2 - earlier OS’s (2k for
example) would simply allow the install app to complete, and the next
time time PnP dev tree was rescanned (either next reboot, or explicitly
by the install app), they’d just raise a couple of dialogs indicating
things were being installed, and hey-presto, it all worked!

So basically:

  • The install looks unprofessional.
  • The dialogs raised let the user faff with what should be a smooth
    install process.

This is one situation where I feel that the security considerations of
SP2 seem to have made things distinctly worse (if theoretically more
secure) from the users P.O.V.

How do I sort this?

MH.

This email and any attachments is confidential, may be legally
privileged and is intended for the use of the addressee only. If you are
not the intended recipient, please note that any use, disclosure,
printing or copying of this email is strictly prohibited and may be
unlawful. If received in error, please delete this email and any
attachments and confirm this to the sender.

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Depending on some configuration in the install app, either
SetupCopyOEMInf or UpdateDriverForPlugAndPlayDevices.

Looks like I’ll have to consider driver signing.

MH.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Rob Linegar
Sent: 06 January 2005 16:04
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to get rid of those “delightful” “found new
hardware” dialogs.

To get rid of * ALL * the boxes you would need to sign your driver/s.

Don’t think there’s much you can do for the other situations.

How are you installing you devices from your installation? Via
SetupOEMCopyInf etc or…?

BR,

Rob Linegar
Software Engineer
Data Encryption Systems Limited
www.des.co.uk | www.deslock.com

This email and any attachments is confidential, may be legally privileged and is intended for the use of the addressee only. If you are not the intended recipient, please note that any use, disclosure, printing or copying of this email is strictly prohibited and may be unlawful. If received in error, please delete this email and any attachments and confirm this to the sender.

Ok… So am kind of on the same wavelength :slight_smile:

This is fresh in my mind as I’m currently in the middle of writing
something to preinstall signed drivers for a couple USB devices.

I can’t think of a situation where you’d call
UpdateDriverForPlugAndPlayDevices on installation without calling
SetupCopyOEMInf first.

If your device is removable there is also another necessary stage which
is to mark all non-present devices for reinstallation on the next
insertion.
UpdateDriverForPlugAndPlayDevices only handles updating devices that are
present.

This MSDN document is what I followed to learn while I was doing it.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install
/hh/install/custom-install_882a44b1-2b4f-44cd-8215-e118866e3a94.xml.asp

However… I do have one idea that may help you a little.

If I understand you right… you don’t want to trigger the install for
the drivers for your child devices until
you have actually preinstalled them…

So why change your main device to not create the child devices. And add
a custom IOCTL to your main device that tells it that its allowed to
create them. You would send this from your install after the child
devices have been preinstalled.
You’d also need to add a registry value to tell it that its allowed to
create the devices in future…

We’ve had to do something similar with am EZUSB based device to get
around a race condition in pnpmgr during installation.

Ultimately though. The only way to remove all the dialogs is to use
signed drivers.

BR,

Rob Linegar
Software Engineer
Data Encryption Systems Limited
www.des.co.uk | www.deslock.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin C Harvey
Sent: 06 January 2005 16:50
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to get rid of those “delightful” “found new
hardware” dialogs.

Depending on some configuration in the install app, either
SetupCopyOEMInf or UpdateDriverForPlugAndPlayDevices.

Looks like I’ll have to consider driver signing.

MH.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Rob Linegar
Sent: 06 January 2005 16:04
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to get rid of those “delightful” “found new
hardware” dialogs.

To get rid of * ALL * the boxes you would need to sign your driver/s.

Don’t think there’s much you can do for the other situations.

How are you installing you devices from your installation? Via
SetupOEMCopyInf etc or…?

BR,

Rob Linegar
Software Engineer
Data Encryption Systems Limited
www.des.co.uk | www.deslock.com

This email and any attachments is confidential, may be legally
privileged and is intended for the use of the addressee only. If you are
not the intended recipient, please note that any use, disclosure,
printing or copying of this email is strictly prohibited and may be
unlawful. If received in error, please delete this email and any
attachments and confirm this to the sender.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com