Jump to content

Drivers from CD: Simple Method


a06lp

Recommended Posts


guys but the driver that i have to put in Drivers folder has to be unpacked (example i extract a rar file or a setup.exe) or i can leave the only setup.exe? do i have to create folders for each driver? thanks

As I told you in your PM to me:

extract the files. (there should be an "ini" file, along with other files)

you can, but don't have to, create subfolders in Drivers. It will detect which driver is needed.

Link to comment
Share on other sites

  • 2 weeks later...
Arguments="/Q /C FOR /F %I IN (%SystemRoot%\SYSTEM32\$WINNT$.INF) DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (start /min /D%J Autoit3.exe Drivers.au3)))"

using DetachedProgram to scan dospath should consider a hack, tho it works currently, it may not perm.

In that post, I suggested to have a much simpler Arguments line in Winnt.sif:

DetachedProgram = cmd.exe
Arguments = "/Q /C START /MIN %SYSTEMDRIVE%\Drivers.cmd"

and to do the dospath scan comfortably from the Drivers.cmd that would have been copied to %SYSTEMDRIVE% through '$OEM$\$1'.

The only problem with that method is when OemPreinstall has to be set to 'No'. Because Drivers.cmd could not be copied over. It's always possible to have it copied by another method during text mode setup but this involves even more integration.

So I managed an Arguments line for the DetachedProgram in Winnt.sif that may be more universal:

- It do a better scan of $WINNT$.INF, really looking for the dospath line.

- It does not require to copy anything from the $OEM$ folder.

- Moreover, it adresses the problem of the missing trailing "\" for installations using a local source (from dos, network, etc.).

Here it is:

DetachedProgram = cmd.exe
Arguments = "/Q /V:ON /E:ON /C FOR /F %I IN (%SystemRoot%\SYSTEM32\$WINNT$.INF) DO (SET LINE=%I&& SET DEB=!LINE:~0,7!&& IF dospath==!DEB! (SET dosP=!LINE:~8!&& (IF NOT !dosP:~-1!==\ SET dosP=!dosP!\) && START /MIN !dosP!$OEM$\Detached.cmd))"

Besides being unreadable ;), the 'Arguments' is one single line, which has no other quotes than the surrounding one (as required by winnt.sif syntax) and where every space in it is important!

I'm using it here (for another purpose than drivers installation) and it works very fine.

Link to comment
Share on other sites

@ Djé

Would this shorter code not do the same thing, apart from the minimized running of the batch file.

DetachedProgram = cmd.exe
Arguments = "/Q /C FOR /F %? IN ('FINDSTR/I DOSPATH= ^<%SYSTEMROOT%\SYSTEM32\$WINNT$.INF') DO (IF ERRORLEVEL 0 (SET %? &CALL %dospath:~0,2%\$OEM$\Detached.cmd))"

Link to comment
Share on other sites

:w00t: use FINDSTR, SET %? and CALL :thumbup

Sorry if I was not clear about that, but dospath is not always just a drive path like 'E:\':

When installing using winnt.exe (or winnt32), you may have to make a local source and $OEM$ would be transfered by winnt.exe to that local source.

The location of the local source FOLDER would then be in the 'dospath' directive (something like 'c:\$WIN_NT$.~LS').

So we need to retreive the full line (and add a trailing '\' to the local source folder name to have the same pattern as with a Cd based install).

This slash thing is why we need the '(IF NOT !dospath:~-1!==\ SET dospath=!dospath!\)' (and so delayed expansion).

I'll try to shorten this as well using CALL.

Also, I am not sure that CALLing a .cmd file works @T39. I've read about and painfully experimented troubles when not using START. Do you know better?

[EDIT] this is not yet working properly @T39, see post below for the solution[/EDIT]:

DetachedProgram = cmd.exe
Arguments = "/Q /V:ON /C FOR /F %? IN ('FINDSTR/I DOSPATH ^<%SYSTEMROOT%\SYSTEM32\$WINNT$.INF') DO (IF ERRORLEVEL 0 (SET %?&& (IF NOT !dospath:~-1!==\ SET dospath=!dospath!\) && START !dospath!$OEM$\Detached.cmd))"

Edited by Djé
Link to comment
Share on other sites

Got it! :P

[EDIT] this is not yet working properly @T39, see post below for the solution[/EDIT]:

DetachedProgram = cmd.exe
Arguments = "/Q /C FOR /F %? IN ('FINDSTR/I DOSPATH= ^<%SYSTEMROOT%\SYSTEM32\$WINNT$.INF') DO (IF ERRORLEVEL 0 (SET %?\&& CALL START %dospath:\\=\%$OEM$\Detached.cmd))"

No more delayed expansion thanks to Yzöwl.

I'm gonna test the CALL START in real T39 situation soon.

@Yzöwl, why would we need the input redirection to FINDSTR (<)? why not just feed it directly with the file name? :

FINDSTR/I DOSPATH= %SYSTEMROOT%\SYSTEM32\$WINNT$.INF

We may also want to specify the start of the line: ^^DOSPATH=

Edited by Djé
Link to comment
Share on other sites

We shouldn't need it! I was being extra cautious due to the lack of quotes for the findstr command. We dont want findstr thinking that %systemroot… etc. was part of the search string

<Edit>

Just as an after thought, if you are sure that the 'dospath=' line is added to every $WINNT$.INF then you can dispense with the IF ERRORLEVEL 0 too!

    DetachedProgram = cmd.exe
Arguments = "/Q /C FOR /F %? IN ('FINDSTR/I DOSPATH= %SYSTEMROOT%\SYSTEM32\$WINNT$.INF') DO (SET %?\&& CALL START /MIN %dospath:\\=\%$OEM$\Detached.cmd)"

</Edit>

Edited by Yzöwl
Link to comment
Share on other sites

LOL: the 'FINDSTR/I DOSPATH= %SYSTEMROOT%\SYSTEM32\$WINNT$.INF' command is finding ... itself! :D

... because the 'Arguments' line remains in $WINNT$.INF which is a cleaned-up copy of the answer file.

--> So we really have to specify to search at the beginning of the lines.

In facts, we have to double-escape the caret:

^^^^DOSPATH=

Jupiter knows why...

Luckily, while in $WINNT$.INF all other lines are written (in text mode setup) with spaces surrounding the '=' sign and all values (double-)quoted, the very 'dospath' line is added (in GUI mode setup) with no space nor quote:

dospath=C:\$WIN_NT$.~LS

If it were not like this, FOR would only return 'dospath' and not the value.

(Note that there is NEVER any space in the value itself, as the only possible values for dospath are 'X:\' or 'Y:\$WIN_NT$.~LS', X & Y being drive letters, since only a 'temp drive' can be specified for winnt.exe or winnt32.exe).

As you adviced, Yzöwl, I also removed the 'IF ERRORLEVEL 0' as I'm pretty sure the 'dospath' line is ALWAYS added (by Setup?).

And anyway, who cares? If it's not, FOR will NOT DO anything (as FINDSTR is searching the start of the lines for 'dospath=')

So the (temporary?) final version is:

DetachedProgram = cmd.exe
Arguments = "/Q /C FOR /F %? IN ('FINDSTR/I ^^^^DOSPATH= %SYSTEMROOT%\SYSTEM32\$WINNT$.INF') DO (SET %?\&& CALL START /MIN %dospath:\\=\%$OEM$\Detached.cmd)"

*TESTED* @T39, on a local source installation.

Thanks again Yzöwl for the great simplification.

[EDIT]I guess 'FINDSTR/B dospath=' should work as well and is better looking. I'll test it.

Edited by Djé
Link to comment
Share on other sites

I confirm the new T39-tested final version to be:

DetachedProgram = cmd.exe
Arguments = "/Q /C FOR /F %? IN ('FINDSTR/B dospath= %SYSTEMROOT%\SYSTEM32\$WINNT$.INF') DO (SET %?\&& CALL START /MIN %dospath:\\=\%Detached.cmd)"

@copy-pasters: please note that my Detached.cmd is no more in $OEM$, just at the root.

Link to comment
Share on other sites

Is there any idea why I have no luck for this method when I use the dvd-rom rather than a cd-rom?

Can you be more specific, please?

What do you mean by 'no luck'??? It's very possible that you don't need any luck to use this method, you know...

What fails? Where? When?

When you talk about cd & dvd, are you mentionning the disc or the drive?

Finally, a rather important question regarding this method: how many drivers do you have? Do you use a dvd because you've got so many of them?

Help us to help you.

Link to comment
Share on other sites

  • 2 weeks later...

Only just found this method of doing drivers. Running a build now and working well.

On a multiboot DVD, is it possible to only have one instance of the drivers directory in the root of the DVD, instead of having a driver directory in each $OEM$ folder?

this

<ROOT>
>Drivers
>Drivers\LAN
>Drivers\GFX
>XPHOME
>XPHOME\I386
>XPPRO
>XPPRO\I386

instead of this

<ROOT>
>XPHOME
>XPHOME\$OEM$\drivers
>XPHOME\$OEM$\drivers\LAN
>XPHOME\$OEM$\drivers\GFX
>XPHOME\I386
>XPPRO
>XPPRO\$OEM$\drivers
>XPPRO\$OEM$\drivers\LAN
>XPPRO\$OEM$\drivers\GFX
>XPPRO\I386

Edited by djackson
Link to comment
Share on other sites

@MC

Tried that (with Balder Multiboot) and it works fine. Just that I'm using the latest BtS driver packs and they come to about 520Mb (compressed) for the lot.

When it comes to an AiO DVD (XPpro, XPhome, XPnlite, etc) @ 500+Mb each, takes a bit of time to copy and a lot of time for the app to sort thru all files only to keep one of each. I've been doing it that way for some time, except copying PNP drivers to disk. Just wondering if there is a way to keep one master copy in the root of the DVD. Not an issue if not possible, but never hurts to ask, worst that can happen is I'm no better off than I am now

cheers

Dave

Edited by djackson
Link to comment
Share on other sites

On a multiboot DVD, is it possible to only have one instance of the drivers directory in the root of the DVD, instead of having a driver directory in each $OEM$ folder?

You may want to give a try to this method of finding the Drivers.cmd from DetachedProgram in winnt.sif.

Just replace 'Detached.cmd' by something like '..\Drivers\Drivers.cmd'

That way you could use any path.

Check the value of 'dospath' in the '\SYSTEM32\$WINNT$.INF' when you install from your multiboot DVD, and adapt from that.

Also, you may want to share the $OEM$ at the root as well by using something like:

OEMFilesPath=..\..\$OEM$

in the [unattended] section of the different winnt.sif files.

Edited by Djé
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...