Jump to content

How to install OEM drivers


ercofra

Recommended Posts

I usually put specific device drivers for my pc hardware in the folder $OEM$\$1\Drivers and I update WINNT.SIF with "OemPnPDriversPath=drivers_paths" under the [unattended] section; drivers are installed correctly if I install XP using a CD-R, but if I install XP from USB (after preparing my USB-stick with USB_MultiBoot_10), new drivers are not installed.

I've read that the [unattended] section of WINNT.SIF during USB setup is ignored, but I've not found any solution for the OemPnPDriversPath line.

Where I have to put my updated drivers for getting Windows Setup to install them?

Link to comment
Share on other sites


Try this:

http://www.msfn.org/board/WinSetupFromUSB-...UI-t120444.html

It should handle [unattended] section properly. Please let me know if it worked fine, amend WINNT.SIF prior to using the program!

...

- if in Windows source folder winnt.sif or unattend.txt are found they will be used as answer file. Section UNATTENDED will be temporarily removed, only for the Text part of setup, and before start of GUI mode it will be merged back. PRESETUP.CMD is used for this purpose.

...

Link to comment
Share on other sites

I like your program very much, just do what I want with simple steps, but unfortunately don't work as expected:

I've had problems with GRUB4DOS loader, my pc rebooted every time before showing boot menu, I've tried all possible combination with FAT/NTFS/only_boot_files with no luck; I've resolved the problem copying a new version of grldr (0.4.4-2008-08-08).

I have 2 partitions in my hard-disk, and the USB drive shifted the second partition letter (D: becomes E:), causing problems with my custom XP setup (I have Documents and Favourites folders in the second partition, the setup assumes second partition is drive D:).

The $OEM$ folders are not copied in drive C:, not only the Drivers folder, but also all the others folders, including Application folders that perform automatic installation during RunOnceEx; I've checked your presetup.cmd, maybe the variable %CDDRIVE% is not set correctly?

Thanks for the great work, hope for a stable release in the future.

Link to comment
Share on other sites

Can you post presetup.cmd in ~LS\I386 folder?

Grub4dos version was the most stable by the time of writing, will be updated, thanks for the feedback.

Can you elaborate a bit more about Documents and Settings issue? How do you use it in your setup?

You may also try this, [unattended] section is not an issue when using alternative location:

http://www.boot-land.net/forums/index.php?showtopic=5306

Link to comment
Share on other sites

$WIN_NT$.~LS\I386\presetup.cmd:

REM ===========Added by WinSetupFromUSB============
IF EXIST %systemroot%\system32\setupold.exe DEL /F %systemroot%\system32\setupold.exe
IF EXIST %CDDRIVE%\$WIN_NT$.~LS\$OEM$\$1\nul xcopy %CDDRIVE%\$WIN_NT$.~LS\$OEM$\$1\*.* %systemdrive%\ /i /k /e /r /y /h
IF EXIST %CDDRIVE%\$WIN_NT$.~LS\$OEM$\$$\nul xcopy %CDDRIVE%\$WIN_NT$.~LS\$OEM$\$$\*.* %systemroot%\ /i /k /e /r /y /h
type %systemroot%\system32\tempunat.inf >> %systemroot%\system32\$winnt$.inf
REM ====================END=======================
EXIT

I have Favorites and Personal folders in the second partition of my hard-disk, so when I do a fresh install of XP in drive C: I don't have to backup and copy these folders in the default locations (C:\Documents and Settings\...); I set up these folders during XP setup importing these registry keys:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Favorites"="D:\\Documenti\\Preferiti"
"Personal"="D:\\Documenti"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Favorites"="D:\\Documenti\\Preferiti"
"Personal"="D:\\Documenti"

So, it's important for me having the second partition of the hard-disk assigned to the letter D: ;

during and after USB XP setup, I have:

C: - first partition of hard-disk

D: - USB drive with empty Favorites and Personal folders created by XP

E: - second partition of hard-disk, with my Favorites and Personal folders not imported in XP

If I use USB_MultiBoot_10, USB drive is assigned to letter U:, so my configuration of XP is correct, because second partition of hard-disk is not shifted to drive E:.

I'm trying to resolve the problem using MkMigrateInf2.cmd.

EDIT:

I've solved the problem of USB-drive letter, by using MkMigrateInf2.cmd H: H:\$WIN_NT$.~BT\migrate.inf, where H: is drive letter of USB-stick target; now during XP setup, USB-drive is assigned to letter U:.

I've solved the problem of $OEM$ folders by replacing ren_fold.cmd with the USB_MultiBoot_10 version, that contains the xcopy commands for copying $OEM$ folders:

@echo off

SET USBDRIVE=
SET TAGFILE=\$WIN_NT$.~BT

:: First Limited Range to Prevent Windows No Drive Alert due to Cardreader
:: For case of Repair Install when Drive not found, than Extended Range and
:: Windows No Drive Alert - Press 4x Continue for Cardreader Drives

FOR %%h IN (C D M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h:

if "%USBDRIVE%" == "" (
FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h:
)

IF EXIST %usbdrive%\$WIN_NT$.~LS\$OEM$\$1\nul (
xcopy %usbdrive%\$WIN_NT$.~LS\$OEM$\$1\*.* "%systemdrive%\" /i /k /e /r /y /h
)

IF EXIST %usbdrive%\$WIN_NT$.~LS\$OEM$\$$\nul (
xcopy %usbdrive%\$WIN_NT$.~LS\$OEM$\$$\*.* %systemroot% /i /k /e /r /y /h
)

ren %USBDRIVE%\txtsetup.sif txtsetup.bak
ren %USBDRIVE%\$WIN_NT$.~BT WIN_NT.BT
ren %USBDRIVE%\$WIN_NT$.~LS WIN_NT.LS

exit

Now custom Applications are installed correctly, but custom Drivers are not yet installed, I'm investigating about it...

An information: the batch file presetup.cmd when is executed? At what point of XP setup and how is invoked? I've found that binifix4.cmd and ren_fold.cmd are invoked from $WIN_NT$.~BT\WINNT.SIF, but I've not found any info about presetup.cmd.

Edited by ercofra
Link to comment
Share on other sites

Presetup.cmd is launched at start of GUI part of Setup, before anything else. It's launched if it's found in I386 or AMD64 folder, no further entries are needed.

There was a bug in WinSetupFromUSB in that version, which was fixed meanwhile, but not released- if presetup.cmd does not exist, some lines were not added.

MkMigrateInf will be included in the next version, most likely as an option. Currently working on the beta version, should be done in a few days- just came back from holiday.

custom Drivers are not yet installed
Whats the path to them in WINNT.SIF? Can you post that part?

Microsoft articles are confusing about where $OEM$ folder should be placed, either in ~LS folder, next to I386, or within I386. Can you copy $OEM$ inside ~LS\I386 and check if Setup finds the DRIVERS folder?

edit:- can you include with your next post Windows setup log files, found in \Windows as attached archive? Need to find where Setup searched for \DRIVERS folder.

Edited by ilko_t
Link to comment
Share on other sites

Thanks ilko_t for your support, I'll give you all the info you need to improve your program.

Meanwhile I've did many tests and I've found interestings things:

I've added these three lines at the end of presetup.cmd to be sure it's executed:

ECHO Testing execution of presetup.cmd>C:\Presetup.txt
DIR U:\*.* /S/A/ON>C:\USB_Dir.txt
DIR C:\*.* /S/A/ON>C:\Root_Dir.txt

If presetup.cmd is executed, there will be three text files (Presetup.txt, USB_Dir.txt and C:\Root_Dir.txt) in the root of drive C: after XP setup;

I've not found these files, so the conclusion is that presetup.cmd is not executed.

I've searched in Microsoft support sites for info about file presetup.cmd and I've found only this page:

Using Custom Setup Scripts

where says that presetup.cmd is used in "Windows Embedded for Point of Service" during setup in conjunction with SetupLauncher.exe.

No other info about it, so I assume that presetup.cmd is not supported by standard Windows XP setup.

Instead I've found that presetup.cmd is created and integrated in XP source by BTS DriverPacks (I've not used them), so I've tried to install DriverPacks for testing and checking modifcations done; I've seen that DriverPacks replace the original setup.exe with a custom version, and rename the original setup.exe in setupORG.exe; if you try to load the custom version of setup.exe in a empty folder you get this message:

presetup.cmd - FILE NOT FOUND !
setupORG.exe - FILE NOT FOUND !
(setupORG.exe -> Original windows Setup.exe)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
POSSIBLE CAUSE:
1. "Presetup.cmd" not exist in the i386 folder on UXPCD
"setupORG.exe" not exist in the i386 folder on UXPCD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. Check your "Txtsetup.sif" in the i386 folder on UXPCD
--- Txtsetup.sif: -------------------------------
[SourceDisksFiles]
setupORG.exe = 1,,,,,,,2,0,0; must exist
presetup.cmd = 1,,,,,,,2,0,0; must exist
---------------------------------------------------
SETUP ABORT

If you look inside setup.exe you'll find other error strings:

"setup.exe" cannot be renamed into "setupold.exe". - Setup Abort !
"setupORG.exe" cannot be renamed into "setup.exe". - Setup Abort !
Fake Setup call himself instead original "Setup.exe". - Setup Abort !

Also check this topic:

SOLVED: drivers from CD, possible even without winnt.sif

So I've come to this conclusion:

DriverPacks version of setup.exe perform these operations:

- Rename setup.exe in setupold.exe (modified version of setup.exe)

- Rename setupORG.exe in setup.exe (original version of setup.exe)

- Execute presetup.cmd (presetup.cmd delete setupold.exe and execute other commands)

- Execute original setup.exe

So, I've modified manually my USB XP source by renaming original setup.exe (it's compressed in setup.ex_, so I've uncompressed it before renaming) in setupORG.exe and copying DriverPacks version of setup.ex_, also I've changed txtsetup.sif by adding setupORG.exe=1,,,,,,,2,0,0;

now after XP setup I've found the three text files created by presetup.cmd in the root of drive C:, and the updated $winnt$.inf in system32 with my [unattended] section, so presetup.cmd is executed now!

I've restored original ren_fold.cmd and I've updated presetup.cmd by adding code to detect USB drive letter, so XCOPY commands can be executed correctly; I've installed again XP with this latest version of USB XP source, and the result is that everything worked fine as expected, except for the device drivers still not installed, I don't know why, maybe the OemPnPDriversPath line is ignored.

I have my device drivers uncompressed in these USB folders:

$WIN_NT$.~LS\$OEM$\$1\Drivers\000_chipset
$WIN_NT$.~LS\$OEM$\$1\Drivers\001_ethernet
$WIN_NT$.~LS\$OEM$\$1\Drivers\002_graphics
$WIN_NT$.~LS\$OEM$\$1\Drivers\003_audio

They are copied in system drive C: by my modified version of presetup.cmd, so after setup I have:

C:\Drivers\000_chipset
C:\Drivers\001_ethernet
C:\Drivers\002_graphics
C:\Drivers\003_audio

My original WINNT.SIF:

[Data]
AutomaticUpdates = Yes
AutoPartition = 0
MsDosInitiated = 0
UnattendedInstall = Yes

[Unattended]
UnattendMode = FullUnattended
UnattendSwitch = Yes
OemSkipEula = Yes
OemPreinstall = Yes
OemPnPDriversPath = Drivers\000_chipset;Drivers\001_ethernet;Drivers\002_graphics;Drivers\003_audio
DriverSigningPolicy = Ignore
FileSystem = *
TargetPath = \Windows
WaitForReboot = No
Hibernation = No

[GuiUnattended]
AdminPassword = ...
AutoLogon = Yes
EncryptedAdminPassword = No
OEMSkipRegional = 1
OEMSkipWelcome = 1
ProfilesDir = "%SystemRoot%\Profiles"
TimeZone = 110

[UserData]
ProductKey = ...
FullName = ...
OrgName = ""
ComputerName = EDEN

[RegionalSettings]
LanguageGroup = 1
SystemLocale = 00000410
UserLocale = 00000410
InputLocale = 0410:00000410

[Display]
BitsPerPel = 32
Xresolution = 1280
YResolution = 1024
Vrefresh = 75

[Identification]
JoinWorkgroup = MSHOME

[Networking]
InstallDefaultComponents = Yes

My C:\WINDOWS\system32\$winnt$.inf after setup:

[SetupParams]
UserExecute=ren_fold.cmd

[GuiRunOnce]
"binifix4.cmd c:"

[Networking]
InstallDefaultComponents=Yes

[Identification]
JoinWorkgroup=MSHOME

[Display]
BitsPerPel=32
Xresolution=1280
YResolution=1024
Vrefresh=75

[RegionalSettings]
LanguageGroup=1
SystemLocale=00000410
UserLocale=00000410
InputLocale=0410:00000410

[UserData]
ProductKey=...
FullName=...
OrgName=""
ComputerName=EDEN

[GuiUnattended]
AdminPassword=
AutoLogon=Yes
EncryptedAdminPassword=No
OEMSkipRegional=1
OEMSkipWelcome=1
ProfilesDir="%SystemRoot%\Profiles"
TimeZone=110

[Data]
floppylessbootpath=\Device\HardDisk1\partition1
producttype=winnt
standardserverupgrade=no
win31upgrade=no
sourcepath=\device\harddisk1\partition1\$win_nt$.~ls
AutomaticUpdates=Yes
AutoPartition=0
MsDosInitiated=1
UnattendedInstall=yes
floppyless=1
winntupgrade=no
win9xupgrade=no
EulaComplete=1
dospath=U:\$WIN_NT$.~LS

[Unattended]
UnattendMode=FullUnattended
UnattendSwitch=Yes
OemSkipEula=Yes
OemPreinstall=Yes
OemPnPDriversPath=Drivers\000_chipset;Drivers\001_ethernet;Drivers\002_graphics;Drivers\003_audio
DriverSigningPolicy=Ignore
FileSystem=*
TargetPath=\Windows
WaitForReboot=No
Hibernation=No

I don't know what to try next for using this method, drivers are in the correct place and $winnt$.inf has the correct OemPnPDriversPath line, but XP refuses to install them.

I'm considering using the method of Pyron explained in the above topic, requires more manual work but maybe works.

EDIT: Windows log files added.

WindowsLogs.rar

Edited by ercofra
Link to comment
Share on other sites

Excellent work, thanks :)

Can you check if "Drivers\000_chipset;Drivers\001_ethernet;Drivers\002_graphics;Drivers\003_audio..." with %SystemRoot% at front are present in

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion -->DevicePath

If not present, then they may be added by Text portion of Setup, not by the GUI when we merge [unattended] section back. In this case we may use presetup.cmd to add those keys to the registry. Vernalex Sysprep Driver Scanner would be of good use for the purpose. The next step would be to make sure presetup.cmd is always executed, will investigate that further.

Link to comment
Share on other sites

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath contains only "%SystemRoot%\inf"; so if I update this registry key by adding drivers paths during execution of presetup.cmd, I resolve the problem? It's a simple solution, I can try it.

Thanks for the suggestions.

EDIT:

Finally it WORKS! :thumbup

I've added this command to presetup.cmd:

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion /v DevicePath /t REG_EXPAND_SZ /d "%%SystemRoot%%\inf;%%SystemDrive%%\Drivers\000_chipset;%%SystemDrive%%\Drivers\001_ethernet;%%SystemDrive%%\Drivers\002_graphics;%%SystemDrive%%\Drivers\003_audio" /f

Now XP finds and loads drivers correctly!

My complete presetup.cmd:

@ECHO OFF

SET USBDRIVE=
SET TAGFILE=\$WIN_NT$.~LS

:: First Limited Range to Prevent Windows No Drive Alert due to Cardreader
:: For case of Repair Install when Drive not found, than Extended Range and
:: Windows No Drive Alert - Press 4x Continue for Cardreader Drives

FOR %%H IN (C D M N O P Q R S T U V W X Y) DO IF EXIST "%%H:%TAGFILE%" SET USBDRIVE=%%H:

IF "%USBDRIVE%" == "" (
FOR %%H IN (E F G H I J K L) DO IF EXIST "%%H:%TAGFILE%" SET USBDRIVE=%%H:
)

REM ===========Added by WinSetupFromUSB============
IF EXIST %systemroot%\system32\setupold.exe DEL /F %systemroot%\system32\setupold.exe
IF EXIST %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$1\nul xcopy %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$1\*.* %systemdrive%\ /i /k /e /r /y /h
IF EXIST %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$$\nul xcopy %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$$\*.* %systemroot%\ /i /k /e /r /y /h
type %systemroot%\system32\tempunat.inf >> %systemroot%\system32\$winnt$.inf
REM ====================END=======================

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion /v DevicePath /t REG_EXPAND_SZ /d "%%SystemRoot%%\inf;%%SystemDrive%%\Drivers\000_chipset;%%SystemDrive%%\Drivers\001_ethernet;%%SystemDrive%%\Drivers\002_graphics;%%SystemDrive%%\Drivers\003_audio" /f

EXIT

OK, we've found a solution, now it's up to you to implement it in your program for preparing setup files automatically.

Thanks!

:hello:

Edited by ercofra
Link to comment
Share on other sites

Good job :)

That means Text mode part adds those paths to the registry.

Can you do another test, I think Vernalex spdrvscn.exe will come handy in order to automate adding paths to drivers.

Can you replace REG ADD... line with:

%SystemDrive%\Drivers\spdrvscn.exe /p %SystemDrive%\Drivers /a /s /q

and copy spdrvscn.exe in %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$1\Drivers\

If it works I am thinking of a line like:

IF EXIST %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$1\Drivers (
%SystemDrive%\Drivers\spdrvscn.exe /p %SystemDrive%\Drivers /a /s /q
)

If you don't need to keep those drivers, you could not copy them and use paths on the USB disk itself...

I will work a bit to add support for presetup.cmd, should be fine for x64 versions too:

http://www.msfn.org/board/x64-Drivers-From-CD-t50023.html

Thanks for your feedback :hello:

ilko

Link to comment
Share on other sites

May be it is possible to place OemPnPDriversPath entry in the [Data] Section Instead of in the [unattended] section.

Such solution works for a lot of entries in [unattended] section like

[Data]

UnattendSwitch = "Yes"

DriverSigningPolicy=Ignore

NonDriverSigningPolicy=Ignore

Link to comment
Share on other sites

Can you replace REG ADD... line with:

%SystemDrive%\Drivers\spdrvscn.exe /p %SystemDrive%\Drivers /a /s /q

and copy spdrvscn.exe in %USBDRIVE%\$WIN_NT$.~LS\$OEM$\$1\Drivers\

OK, I'll try it...

Meanwhile I've did a simple script for adding drivers paths to registry, it must be added at the end of presetup.cmd:

setlocal enableextensions enabledelayedexpansion
set RegKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion

if exist "%SystemDrive%\Drivers" (

for /f "usebackq tokens=1,2*" %%d in (`reg query %RegKey% /v DevicePath`) do (
if "%%d"=="DevicePath" set DevicePath=%%f
)

for /d %%d in (%SystemDrive%\Drivers\*.*) do set DevicePath=!DevicePath!;%%d

reg add %RegKey% /v DevicePath /t REG_EXPAND_SZ /d "!DevicePath!" /f
)

It updates the registry key DevicePath by adding every subdirectories found under %SystemDrive%\Drivers; it preserves paths already set in the key (like "%SystemRoot%\inf"). I've already tried it, works well.

May be it is possible to place OemPnPDriversPath entry in the [Data] Section Instead of in the [unattended] section.

I'll try it too, thanks. (EDIT: Tried, don't work.)

EDIT:

I've tried spdrvscn.exe, but I've added the option /i (this will import the current DevicePath from the registry into the path lists, this is useful if you just want to append additional paths), for preserving %SystemRoot%\inf.

Worked fine!

Suggestion: if you want to replicate the OemPnPDriversPath entry in WINNT.SIF, you can use spdrvscn.exe with the option "/d append_path /s /q /i" for adding the same paths specified in OemPnPDriversPath, without automatic check for validity, in the same way as XP text-mode setup does; your program can scan WINNT.SIF for the presence of the OemPnPDriversPath entry, and if present, can add the spdrvscn.exe command in presetup.cmd for adding those paths to the registry key.

Also, you can add an option for configuring automatically drivers paths even if OemPnPDriversPath is not present; user is prompted for a search path that will be recursively searched for inf files (using spdrvscn.exe /p search_path /a /s /q /i).

Edited by ercofra
Link to comment
Share on other sites

  • 1 month later...

Solved in the last version.

Presetup.cmd is always executed, if BTS DP was not used, their setup-ex_ is copied and used, old setup.exe is setuporg.exe.

If oempreinstall=yes is found, the relevant entries are added in presetup.cmd in order to copy $oem$ folders.

If OemPnPDriversPath is found, it's values are parsed and passed to spdrvscn.exe, executed again by presetup.cmd

WatchDriverSigningPolicy.exe is included in the download, but entries not added to presetup.cmd, this has to be done manually.

Tested on both 32 and 64 bit XP versions.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...