Updated: 11/08/05 (The old AutoIt Method is available here.)
This is not my method. Major thanks to idle.newbie and hp38guser, as most of this is their work.
Thanks also go out to Pyron for making SetupCopyOEMInf.exe and WatchDriverSigningPolicy.exe, which are used in this method.
The info from this outline is from this post, and, more specifically: here, here, and here.
This is a method of automatically installing drivers (which are located on your CD), for devices that are plugged into the computer that WindowsXP is being installed on. This new way uses a Batch file. Why another way, you ask? The reason is simple:
This method does not need the use of a FAKE setup.exe, nor does it need extra lines in TXTSETUP.SIF (like other methods do). It's very simple and straightforward.
It's as easy as 1, 2, 3:
1. Download the attached zip file, and unzip its contents to $OEM$\.
(There are 6 files in the zip: 7za.exe, Drivers.cmd, nircmd.exe, Process.exe, SetupCopyOEMInf.exe, WatchDriverSigningPolicy.exe)
(These files will run from the CD, and are never copied to the Hard Drive.)
2. Open up winnt.sif (located in i386), and add two lines under [GuiUnattended], as shown below:
If you WANT the cmd window (batch file) to show, use THIS code:
Winnt.sif
CLS @ECHO OFF TITLE Drivers-from-CD Installation color 1F :: Set Current Drive as CD CD /D "%~dp0" :: Set Drivers Location Folder SET DRV=Drivers :: Ticker script ECHO.exec hide %CD%\Process.exe -r setup.exe >%SystemDrive%\Ticker.ncl ECHO.wait 10000 >>%SystemDrive%\Ticker.ncl ECHO.exec hide %CD%\Process.exe -p SetupCopyOEMInf.exe high >>%SystemDrive%\Ticker.ncl ECHO.exec hide %CD%\Process.exe -s setup.exe >>%SystemDrive%\Ticker.ncl ECHO.wait 50000 >>%SystemDrive%\Ticker.ncl ECHO.script %SystemDrive%\Ticker.ncl >>%SystemDrive%\Ticker.ncl :: Pre-Install (Suspend Setup, and Set Setup to Low Priority) .\Process.exe -s setup.exe .\Process.exe -p setup.exe low :: Allow for Unsigned Drivers START .\WatchDriverSigningPolicy.exe :: If Compressed Drivers Exist, Unzip Them & Change Drivers Location Folder to Hard Drive IF EXIST Drivers.7z ( SET DRV=%SystemDrive%\Drivers .\7za.exe x -y -aoa -o"%SystemDrive%\Drivers" ".\Drivers.7z" ) :: Run NirCmd Ticker Script (code above) START .\NirCmd.exe script %SystemDrive%\Ticker.ncl :: Install Drivers .\SetupCopyOEMInf.exe "%DRV%" :: Post-Install (Close NirCmd, Setup Priority back to Normal, Resume Setup) .\Process.exe -k NirCmd.exe .\Process.exe -p setup.exe normal .\Process.exe -r setup.exe :: Delete Ticker File DEL %SystemDrive%\Ticker.ncl EXIT
NirCmd v1.80
Created by NirSoft (link)
Used to run Ticker script.
Process.exe v2.03
Created by Beyond Logic (link)
Used to pause setup, set process priorities, and kill processes while drivers install.
SetupCopyOEMInf.exe
Created by Pyron (link)
It scans a dir recursively and calls SetupCopyOEMInf for every .inf it finds (which copies a specified .inf file into the %windir%\Inf directory).
WatchDriverSigningPolicy.exe
Created by Pyron (link)
Basically, this makes it so that when Windows finds non-signed drivers (non-WHQL), it doesn't care.
The source for WatchDriverSigningPolicy is here. Although the attachment doesn't seem to be working, the basic outline of the code is in the post.
How Does It Work? (A Much Simplified Guide)
When Windows Setup reads the GuiUnattended section of winnt.sif, it will load up our Drivers.cmd code.
The Drivers.cmd file will first pause Windows Setup (using Process.exe).
Next, it will activate WatchDriverSigningPolicy.exe so that we can install unsigned drivers.
The batch script will then determine if compressed drivers exist. If so, it will extract them.
Then it will run SetupCopyOEMInf.exe to scan every subdirectory in $OEM$\Drivers (or %systemdrive%\Drivers if compressed drivers exist) and add copy all the .inf files so that Windows will recognize and install drivers for every PnP device (that you included drivers for).
Finally, we resume Windows Setup (again, using Process.exe).
What About Compressed Drivers?
If you use compressed (.7z) drivers, make sure to ADD your compressed "Drivers.7z" to the $OEM$ folder. The batch will automatically detect the compressed drivers (make sure it is named "Drivers.7z"), unzip it to the Hard Drive (using the included "7za.exe"), and then scan the Hard Drive (instead of the CD) for .inf files.
Updates:
11/08/05: Major updates:
- Solved the problem of setup continuing before all the .inf files are scanned and integrated.
- New Method - (Batch file instead of AutoIt) - Windows Setup will now pause (based on this post and also this post and this post).
- Added Process.exe v2.03, and NirCmd v1.80 to the zip - These are the programs we use to pause Windows Setup.
- This method now works with compressed drivers - just add your "Drivers.7z" to the $OEM$ folder. The batch takes care of the rest.

08/01/05: Re-uploaded the zip file. The only updated file in the zip is the Drivers.au3 - it's a smaller file, with less coding (i.e., no extra crap, as per hp38guser's request (here). It has been tested, and is working.
Attachment Updated: 11/08/05
MD5 Hash: E6FCD3B433BA04D0F0CC96CB7613DA0A
Download from Mirror 1
Download from Mirror 2 (please try above link first...)
This post has been edited by a06lp: 30 November 2005 - 05:50 PM



Help


Back to top









