Skip to content
⌘ NSIS Forum Archive

how to run hardware autodetection wizard

8 posts

shantanu_gadgil#

how to run hardware autodetection wizard

How to make the "harware detetction" start and make it scan for new hardware.

Running "devmgmt.msc" is one way but I still have to choose "scan for harware" from the menu.

Is there any "proper" 🙂 method ?
shantanu_gadgil#
thanks for the reply (both) 🙂 ...but this starts the "Add new hardware wizard". 🙂

What I had in mind was:
1. Start the "Device Manager" of Win2k/XP
2. Click on the COMPUTER icon (the root of the tree-view)
3. Click menu... Action > Scan for harware changes

These three steps somehow automated!?!

Any ideas ? 🙁
bluenet#
A instdrv Plugins may help you.

delmardale#
Try this tool provided by microsoft:

FILE: DevCon Command Line Utility Alternative to Device Manager

JeronimoColon#
I have a bit of code that should do this for you. I'll convert it to NSIS script over the weekend.

jc3
JeronimoColon#
As promised:

Function ScanForNewHW
SetPluginUnload alwaysoff
StrCpy $1 ""

System::Call 'setupapi::CM_Locate_DevNodeA(*i .r0, t r1, i r2) i .r3'
System::Call 'setupapi::CM_Reenumerate_DevNode(i r0, i r4) i .r5'

SetPluginUnload manual
System::Free 0
FunctionEnd

I had some weirdness converting this but thanks to kichik I'm all sorted out.

Also, I have a plugin that does the same thing if your interested.

jc3