/build/static/layout/Breadcrumb_cap_w.png

PnP Driver install

Here is a fairly simple method to add drivers to the computers PnP list. If someone has the ability could this be added to the PNP Driver Install Template?

The sticky thread "PNP Driver Install Template" is not very useful unless you use Wise installer. I finally gave up on the whole msi thing and started looking in other areas. Here is what I found, pretty simple solution using a VBscript on startup. All that is needed is the driver files copied to the computer (I put them in C:\windows\inf\) and the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ String Value = "DevicePath" appended to have the path to this folder. Restart and windows will automatically create a new .pnf for this driver and install the device automatically when it is plugged in.

Here's the script:

Option Explicit
On Error Resume Next
set oshell=wscript.createobject("wscript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FolderExists("C:\WINDOWS\inf\WPC100") then
objFSO.CopyFolder "\\networkshare\WPC100","C:\WINDOWS\inf\WPC100",True
end if

Dim oShell, keyToPlayWith, oldKeyVal, newKeyVal, stringToAppend, finalReadToTest

keyToPlayWith = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath"
stringToAppend = "C:\windows\inf\wpc100;"
oldKeyVal = oShell.RegRead(keyToPlayWith)
IF InStr(oldKeyVal,stringToAppend) = 0 THEN
newKeyVal = oldKeyVal & stringToAppend

oShell.RegWrite keyToPlayWith,newKeyVal,"REG_EXPAND_SZ"

finalReadToTest = oShell.RegRead(keyToPlayWith)

if finalReadToTest = newKeyVal
end if

0 Comments   [ + ] Show comments

Answers (5)

Posted by: AngelD 15 years ago
Red Belt
0
If I recall the DevicePath has a length limit so you may watch out for that.

To add this to a template just copy the standard one and add it as a custom action. You may need to add some code to get the directory path from a property or similar.
Remove any "wscript." from the script for it to work as a vbscript custom action in deferred execution.

Also you need to have the files installed by the package as the system context (deferred) does not have access to the network.
Posted by: kiptek 15 years ago
Second Degree Green Belt
0
i think he meant get it added to this "template".... http://itninja.com/question/gnu,-freeware-and-shareware-programs-to-cloning596
Posted by: AngelD 15 years ago
Red Belt
0
You're right kiptek, I didn't read his post carefully.
However it is all described in the "Plug and Play driver Installation Explained" link in the sticky as that is how the template was created.
Posted by: philhall 15 years ago
Yellow Belt
0
If you add the driver files to a folder already in the devicepath then you don't need to reboot.

I've tested this successfully with a pcmcia card, I assume this works for USB as well?

Does anyone know if it works for unsigned drivers?
Posted by: turbokitty 15 years ago
6th Degree Black Belt
0
I think there's a dead link in that sticky.

Has anyone tried using the new WDK?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ