MSFN Forum: Drivers from CD: Simple Method - MSFN Forum

Jump to content


  • 12 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Drivers from CD: Simple Method Rate Topic: ***** 1 Votes

#1 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

  Posted 22 July 2005 - 01:59 PM

Drivers From CD (Simple Method)

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. :)
10/11/05: New upload again. This time, the Drivers.au3 file is altered again, and the code to be entered into winnt.sif has been changed. This entire method runs from CD (no files copied over!) This is all from this post. Again- I personally tested this method (as has hp38guser) and it works!
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



#2 User is offline   Acheron 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 938
  • Joined: 28-June 04
  • OS:XP Pro x86
  • Country: Country Flag

Posted 22 July 2005 - 03:04 PM

Please note this does not work for any MassStorage Device. Only plug'n play hardware is detected and installed during Windows Setup.

You can add drivers for any hardware on cd. Whenever you change hardware, Windows will recognize your new hardware and will ask for your cd.

This is my favourite driver installation method.

#3 User is offline   Bâshrat the Sneaky 

  • aka Wim Leers
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,214
  • Joined: 29-October 03
  • OS:none specified
  • Country: Country Flag

Posted 22 July 2005 - 03:24 PM

Maybe it'd be useful if you'd say in the first post that this is a method where drivers are kept, and because they are installed from CD/DVD, you'll always need to insert your CD/DVD to install new drivers.

Or did I miss that part?

#4 User is offline   Acheron 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 938
  • Joined: 28-June 04
  • OS:XP Pro x86
  • Country: Country Flag

Posted 23 July 2005 - 05:25 PM

You are correct. However pnp-devices are detected during Windows Setup after detachedprogram stage so during Windows Setup all drivers are detected and get installed.

If drivers are included for hardware not available during Windows Setup, only the inf's are copied to the Windows INF directory.

#5 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 23 July 2005 - 09:35 PM

hp38guser, on Jul 23 2005, 07:25 PM, said:

pnp-devices are detected during Windows Setup after detachedprogram stage so during Windows Setup all drivers are detected and get installed.

If drivers are included for hardware not available during Windows Setup, only the inf's are copied to the Windows INF directory.
<{POST_SNAPBACK}>


And therefore, this seems to be a great way to install any hardware. If it's in your system now, the drivers are installed during setup.

If you later add a component, and the drivers were originally on the cd, it will ask for the cd.

(I think this is correct - let me know, hp38guser)

#6 User is offline   Bilou_Gateux 

  • Powered by Windows Embedded
  • PipPipPipPipPip
  • Group: Members
  • Posts: 766
  • Joined: 03-January 04

Posted 25 July 2005 - 08:43 AM

a06lp, on Jul 23 2005, 09:35 PM, said:

If you later add a component, and the drivers were originally on the cd, it will ask for the cd.


I have a request because i don't know how to change the drivers.au3 AutoIt code.

I always install Windows from a Network share or from an i386 source folder located on the hard drive (WINNT32.EXE /s:<source_path>) booting first the box with WinPE/BartPE.

My Drivers folder is located on %SystemDrive%\Drivers.

Could you post a modified AutoIt script that search \win51ip.SP2 on local HDD instead of CD. I just need a new subroutine to set $instDrv to another letter than CD letter.
Optional (i can edit the original au3 to replace with my IDTag):
Can you set the IDTag win51ip.SP2 in a variable for use with others Windows versions.

#7 User is offline   Acheron 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 938
  • Joined: 28-June 04
  • OS:XP Pro x86
  • Country: Country Flag

Posted 25 July 2005 - 04:32 PM

Quote

DriveGetDrive
--------------------------------------------------------------------------------
Returns an array containing the enumerated drives.

DriveGetDrive ( "type" )

Parameters

type Type of drive to find:
"ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN"

Return Value

Success: Returns an array of strings (drive letter followed by colon) of drives found. The zeroth array element contains the number of drives.
Failure: Returns numeric 1 and sets @error to 1


Suit yourself. Replace
$CD = DriveGetDrive("CDROM")
by
$CD = DriveGetDrive("FIXED")
to look for win51ip.SP2 on local hdd :hello:

#8 User is offline   erik_demon 

  • Master Chief
  • PipPip
  • Group: Members
  • Posts: 253
  • Joined: 22-August 04

Posted 25 July 2005 - 07:00 PM

@Bashrat

Couldn't this (however modified) replace the current KtD method in DP Base:

For method 2 this would mean:

@presetup.cmd stage extract the DP's

@DetachedProgram stage run the autoit script


This would have the following advantages:

- no limitations to the OemPnPDriversPath problem
- no double work, this way we don't have to use SetDevicePath and SetupCopyOEMInf which safes (a little) time

I believe that this would be quite an improvement :yes:

(hp38guser mentioned this before though ;) )

This post has been edited by erik_demon: 25 July 2005 - 07:03 PM


#9 User is offline   Bilou_Gateux 

  • Powered by Windows Embedded
  • PipPipPipPipPip
  • Group: Members
  • Posts: 766
  • Joined: 03-January 04

Posted 26 July 2005 - 04:26 AM

@hp38guser

hp38guser, on Jul 25 2005, 04:32 PM, said:


:thumbup Thanks!
change done successfull.

Another question. My unattended install is based on "Windows Server 2003, Web Edition Setup"

The autoIT script don't delete the 3 files in @SystemDir.
I have tried to change strings WinWaitActive("Windows Server 2003, Web Edition Setup", "") and WinSetTrans("Windows Server 2003, Web Edition Setup", "",170) with no success.
how can i check the string to use?

@all
When installing only digitally signed drivers (with a cat file), the WatchDriverSigningPolicy.exe is not necessary. I have edited the drivers.au3 autoit script and add a semicolon in front of both lines with WatchDriverSigningPolicy.exe process and successfully unattended install (on a real box, not on a VirtualMachine) Digitally Signed  Drivers.

Quote

Driver signing uses the existing digital-signature cryptographic technology. A hash of the driver binary and relevant information is stored in a catalog file (CAT file), and the CAT file is signed with the Microsoft signature. The driver binary itself is not touched; only a CAT file is created for each driver package. The relationship between the driver package and its CAT file is referenced in the driver's INF file and maintained by the system after the driver is installed.

This post has been edited by Bilou_Gateux: 26 July 2005 - 03:08 PM


#10 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,448
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 27 July 2005 - 08:14 AM

It looks like a really interesting approach.
Thanks to both :
hp38guser
a06lp
:thumbup

jaclaz

#11 User is offline   Acheron 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 938
  • Joined: 28-June 04
  • OS:XP Pro x86
  • Country: Country Flag

Posted 28 July 2005 - 09:00 AM

OK, please don't download these files anymore. The script above contains some unuseful strings. I have asked the TS to remove it, but did not respond to my request.

Here's the correct driver.au3 script:
$CD = DriveGetDrive("CDROM")
For $I=1 to Number($CD[0])
	$pa = $CD[$I] & "\win51ip.SP2"
 	 If FileExists($pa) Then
      $instDrv=$CD[$I]
 	 Endif
Next
ProcessSetPriority ( "setup.exe", 0)
Run($instDrv & "\$oem$\WatchDriverSigningPolicy.exe")
ProcessWait("WatchDriverSigningPolicy.exe")
RunWait($instDrv &  "\$oem$\SetupCopyOEMInf.exe " & $instDrv & "\$oem$\Drivers")
ProcessClose("WatchDriverSigningPolicy.exe")
ProcessSetPriority ( "setup.exe", 2)
FileDelete(@SystemDir & "\driver.au3")


The following files go into $oem$\$$\System32:

autoit3.exe
driver.au3


These files go into $oem$:

SetupCopyOEMInf.exe
WatchDriverSigningPolicy.exe


Users who only use WHQL drivers can use the following code:
$CD = DriveGetDrive("CDROM")
For $I=1 to Number($CD[0])
	$pa = $CD[$I] & "\win51ip.SP2"
 	 If FileExists($pa) Then
      $instDrv=$CD[$I]
 	 Endif
Next
ProcessSetPriority ( "setup.exe", 0)
RunWait($instDrv &  "\$oem$\SetupCopyOEMInf.exe " & $instDrv & "\$oem$\Drivers")
ProcessSetPriority ( "setup.exe", 2)
FileDelete(@SystemDir & "\driver.au3")

This post has been edited by hp38guser: 28 July 2005 - 09:05 AM


#12 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 28 July 2005 - 09:57 AM

@hp38guser:
I recieved your PM, and have been waiting until my next clean install to test the script, and verify that it works. once it does, i will update the first post with all changes that need to be made.
I have also asked you to please explain the script you made more fully, so that we can understand the logic behind the script, and why it works. When you have a chance, please post that (or PM it to me), and I'll update the first post with it.


@all:
for now, however, the download in the first post DOES work (even though it may contain some unneccesary things).

This post has been edited by a06lp: 28 July 2005 - 10:02 AM


#13 User is offline   Bilou_Gateux 

  • Powered by Windows Embedded
  • PipPipPipPipPip
  • Group: Members
  • Posts: 766
  • Joined: 03-January 04

Posted 28 July 2005 - 02:08 PM

@hp38guser:
Thanks for cleaning the code and post again.
Just finished my UA install (on real box) and just discover it. Too late to check this time with 2K3. i will report on my next install...

@a06lp:
Maybe can you add some credits on 1st post to shalti for the original idea of setupcopyoeminf.exe coded by Pyron.
and then ask BtS stickying this post instead ofJust a suggestion...

This post has been edited by Bilou_Gateux: 28 July 2005 - 02:19 PM


#14 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 28 July 2005 - 09:58 PM

a06lp, on Jul 22 2005, 03:59 PM, said:

The info from this outline is from this post...<{POST_SNAPBACK}>


That is from the first post - it's a direct link to schalti. But the real credit goes to the creator of the program.

As for stickying this post - that's not my decision... :blink: :whistle:

This post has been edited by a06lp: 28 July 2005 - 10:00 PM


#15 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 01 August 2005 - 09:11 PM

Updated first post. As of this post, everything is updated and working. =)

#16 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 06 August 2005 - 09:59 PM

[nevermind...]

This post has been edited by a06lp: 12 August 2005 - 11:39 AM


#17 User is offline   evilvoice 

  • Ditchy McAbandonpants
  • PipPipPipPipPip
  • Group: Members
  • Posts: 946
  • Joined: 27-January 04

Posted 10 August 2005 - 02:05 AM

couldnt we include support for 7zip archives?

#18 User is offline   erik_demon 

  • Master Chief
  • PipPip
  • Group: Members
  • Posts: 253
  • Joined: 22-August 04

Posted 10 August 2005 - 08:44 AM

I believe we can if we do it this way

#19 User is offline   evilvoice 

  • Ditchy McAbandonpants
  • PipPipPipPipPip
  • Group: Members
  • Posts: 946
  • Joined: 27-January 04

Posted 10 August 2005 - 09:53 PM

actually, id much rather have it all contained in the autoit script...mainly because of the "RunWait" command...the problem with presetup.cmd is that windows setup DOES NOT pause when executing it, so you could potentially end up with only half the drivers extracted when windows hunts for drivers (at least I heard that was the biggest problem)

#20 User is offline   Acheron 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 938
  • Joined: 28-June 04
  • OS:XP Pro x86
  • Country: Country Flag

Posted 12 August 2005 - 04:54 AM

evilvoice, on Aug 11 2005, 04:53 AM, said:

actually, id much rather have it all contained in the autoit script...mainly because of the "RunWait" command...the problem with presetup.cmd is that windows setup DOES NOT pause when executing it, so you could potentially end up with only half the drivers extracted when windows hunts for drivers (at least I heard that was the biggest problem)
<{POST_SNAPBACK}>


You can't let wait the Windows Setup with AutoIt. However you can force the Windows Setup to idle-mode for the time being.
Reason for me to use AutoIt is the ProcessClose function. When using nLite sometimes Taskkill would fail if you have removed lot's of components

Share this topic:


  • 12 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy