Necros Posted November 14, 2006 Posted November 14, 2006 (edited) Hi all !I'm about testing a couple of little php script using devcon.exe and pnpids.exe.One script associates PnPID to the inf file describing a driver, and the second script uses the previously build database (CSV format) to update drivers if a compatible hardware exists on the system.I coded these scripts quickly and if you thinks they are useful, I may enhance them to build an online database. (after a much proper re-coding)Downloads available at the end of this postMy work is intended to make easier unattended driver setup, without hacking windows setup, and without using registry (directly or indirectly) to store driver path. I think using devcon.exe to update device drivers and pnpids.exe are the best way to respect the windows internal procedure.Features planned:-Automatic creation of a file containing [sysprepMassStorage]-easy to maintain method for both unattended setup and master image management with sysprep-Maintaining an online database with data about each PnPID (sometimes I find unknown hardware and I must search for a manufacturer without having his name)-specific hardware handling: nvidia ethernet adapter are not defined with a PnP ID in inf files (I found a DOS batch file with a workaround; an other workarond is needed to Hercules fortissimo drivers too) Overview of csv file created by the first scriptPCI\VEN_1069&DEV_0050&SUBSYS_00541069;D:\Multi_dvd\sysprep\drivers\04_controller\Mylex LSI Logic\AcceleRAID 160, 170, 352, ExtremeRAID 2000, 3000\2K\ar160.infPCI\VEN_1069&DEV_0050&SUBSYS_00521069;D:\Multi_dvd\sysprep\drivers\04_controller\Mylex LSI Logic\AcceleRAID 160, 170, 352, ExtremeRAID 2000, 3000\2K\ar170.infPCI\VEN_1069&DEV_0050&SUBSYS_00501069;D:\Multi_dvd\sysprep\drivers\04_controller\Mylex LSI Logic\AcceleRAID 160, 170, 352, ExtremeRAID 2000, 3000\2K\ar352.infPCI\VEN_1069&DEV_BA56&SUBSYS_00401069;D:\Multi_dvd\sysprep\drivers\04_controller\Mylex LSI Logic\AcceleRAID 160, 170, 352, ExtremeRAID 2000, 3000\2K\exr2000.infPCI\VEN_1069&DEV_BA56&SUBSYS_00301069;D:\Multi_dvd\sysprep\drivers\04_controller\Mylex LSI Logic\AcceleRAID 160, 170, 352, ExtremeRAID 2000, 3000\2K\exr3000.infPCI\VEN_1095&DEV_3112&SUBSYS_31121095;D:\Multi_dvd\sysprep\drivers\04_controller\Silicon Image\sil 3112\SI3112.infPCI\VEN_1095&DEV_3112&SUBSYS_34238086;D:\Multi_dvd\sysprep\drivers\04_controller\Silicon Image\sil 3112\SI3112.infPCI\VEN_1095&DEV_3112&SUBSYS_311215D9;D:\Multi_dvd\sysprep\drivers\04_controller\Silicon Image\sil 3112\SI3112.infPCI\VEN_1095&DEV_3112&SUBSYS_B0021458;D:\Multi_dvd\sysprep\drivers\04_controller\Silicon Image\sil 3112\SI3112.infTo use these scripts you need php 5.1.2; use it as a command line script interpreter http://www.php.netI tried to run with success php interpreter in a folder containing only php.exe and php5ts.dll (without any path pointing to the full version of php in the %path% environment variable)To download devcon.exe goto http://support.microsoft.com/kb/311272To get Sysprep 1.1 for windows 2000 http://www.microsoft.com/downloads/details...;displaylang=enFor windows XP find deploy.cab in your original XP cdrom.update your environment variable %path% to your php interpretercreate a folder (anywhere you want) containing devcon.exe and pnpids.exedownload into this folder the php scriptsto fill the csv file used as database open a command prompt and type php -f "driver detect.php" <Driver_Collection><Driver_Collection> is a path to a folder containing a driver pack. each subfolder is scanned for inf file. Each inf file is read with pnpids.exe.To update your system open a command prompt and type php -f "driver install.php"If a hardware PnPID is detected in both your computer and the csv file, devcon.exe will update your driver.I will test my work on several computers deployed with sysprep, unattended installations with either drivers from CD or drivers from a network sharesuccess:CSV generation from a folder with few mass storage drivers, and chipset drivers from NVidia, SiS, ALIhardware detection and installation on a scsi cardTest to do:-CSV generation from a huge drivers collection (never used Bâshrat the Sneaky's driver pack, but I think it will work)-device detection and installation on a "driverless" windows (clean install) (need your help guy because there are so many different configuration !) (tests runnings with SiS drivers)HISTORYAdded support for partial PnP ID comparison, need manual csv edit (automatic handling of this case planned)Little bugfix in driver install.phpAdded several drivers install for a single hardware instance (experimental) (I wish the most up to date driver on the host system)Downloads: Driver_Detect.phpDriver_Install.php Edited November 22, 2006 by Necros
IcemanND Posted November 16, 2006 Posted November 16, 2006 Great idea. I think you might see more interest though if it was written in a native windows script.
Necros Posted November 16, 2006 Author Posted November 16, 2006 (edited) @IcemanND you're right.... but I stopped programming with VB long ago.I made a little batch file to launch my php scripts, now I have to add "driver install.php" in runonce during windows setup. I may launch it directly a T-13 step; but converting into VB may fail if VB scripting components are not already available.I have to try php.exe alone, without any extension or other stuff. If this works, then I will have something similar to AutoIt.I may also code with php4 and use a software to "compile" the script into a single executable containing both php.exe and my script Edited November 16, 2006 by Necros
kickarse Posted November 20, 2006 Posted November 20, 2006 I think I may try this out... let's hope for the best
kodorevi8ulis Posted November 21, 2006 Posted November 21, 2006 (edited) xmmm i can't run pnpids from windows xp (and it isn't inside the deploy.cab) EDITOk i had a problem with some dlls (setupapi and another one) and i used old ones from win2000 Edited November 21, 2006 by kodorevi8ulis
Necros Posted November 21, 2006 Author Posted November 21, 2006 (edited) I'm thinking about drivers packed in a installer software (AND chipset, and ATI + Nvidia video drivers). I have to code a new feature able to detect pnp ID from a specified INF file and add a commandline to start a specific installer with the silent option.@allDid you try installing nvidia drivers from a inf file ? Are Nvidia softwares correctly installed and working (nvidia audio and video especially)I tried to install SiS chipset drivers. I found these issues:ISSUE 1=====- hardware PnP ID for SiS IDE and AGP controllers in .inf files are not telling SubSys partPCI\VEN_1039&DEV_5513;f:\drivers\01_chipset\SiS\95 98 Me NT 2K XP 2003 XP-64 2003-64\R204a\IDE\win2k\SISIDE.INFPCI\VEN_1039&DEV_0001;f:\drivers\01_chipset\SiS\95 98 Me NT 2K XP 2003 XP-64 2003-64\agp121\AGP\current\WIN2000\sisagp.infI added a third column in the database to ignore SubSys ID when comparing the current line from database with a PnP ID found in the host computer.PCI\VEN_1039&DEV_5513;f:\drivers\01_chipset\SiS\95 98 Me NT 2K XP 2003 XP-64 2003-64\R204a\IDE\win2k\SISIDE.INF;no_subsysPCI\VEN_1039&DEV_0001;f:\drivers\01_chipset\SiS\95 98 Me NT 2K XP 2003 XP-64 2003-64\agp121\AGP\current\WIN2000\sisagp.inf;no_subsysI don't know if devcon may report a hardware PnP ID without SubSys part. I suppose that will never happen.I added the third column by hands. I will suppress this column by checking each PnP ID for SubSys ID, If not present, then trim SubSys ID from the detected PnP ID before comparison.ISSUE 2=====devcon may enforce installation of a driver designed for windows XP on windows 2000. With the IDE driver, a prompt appeared because the driver is not signed. The AGP driver is installed silently, but the computer cannot reboot properly (I had to go back to the last good known configuration)I have to find how to detect each compatible windows for a given INF file, or specify for each .inf file which windows are compatible. Edited November 22, 2006 by Necros
kickarse Posted November 22, 2006 Posted November 22, 2006 (edited) There's a utility that will create a verification of the drivers for youhttp://www.updatexp.com/sigverif-exe.htmlhttp://support.microsoft.com/kb/308514Also I think there's a registry hack that will allow unsigned driversThere's a program that when run will allow installation of unsigned drivers. It's called WatchDriverSigningPolicy.exe .http://www.msfn.org/board/lofiversion/index.php/t57463.htmlhttp://unattended.msfn.org/unattended.xp/view/web/35/ Edited November 22, 2006 by kickarse
Necros Posted November 22, 2006 Author Posted November 22, 2006 (edited) @kickarseHi,I may use REG.EXE to set driver signing policy to ignore and restore it's previous state. I think that's the best way. WatchDriverSigningPolicy is intended to be used with unattended setup, and you're right, I may need it when installing drivers a T-13 step.sigverif.exe is intended to be used to check if a driver has been signed or not. I may use it with a wish to install only signed drivers. However, I don't know how to detect if a driver has been designed for a specific windows version.Driver install.php installed yesterday a SiS AGP driver for windows XP on Windows 2K. I expected windows 2K refuse to install it anyway. @all I need to find a workaround to detect which windows a driver is designed for...I keep this issue open, If we find a suitable workaround for both win 9x and 2K and later systems... Edited November 22, 2006 by Necros
Necros Posted December 26, 2006 Author Posted December 26, 2006 @all Hi, many time elapsed since my last post. I dont' have any tool to ensure windows installs the most appropriate driver. I'd like to try hwphp http://www.paraglidernc.com/HWPnP.html but all my attempts to install a device driver with this tool failed.Maybe I don't understand how it works. :sCan an bartPE expert coud explain how to install a driver with this tool, from the command line ?
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now