Topic: Proper driver prepping for W7

I have been working on this for my own personal DVD for quite some time. Downloading the drivers (using video as an example) and simply uncompressing to a folder will not work if you are planning on injecting them into your W7 image. DISM will fail on /add-driver.
In any case, you must use EXPAND all files ending with an underscore character ( _ ) while leaving the underscore intact.
In my case, I'm downloading a new nVidia package every few months (amongst others) and so I am constantly having to expand these. I've created a batch that makes this effortless so feel free to use. Remember to expand your install.exe into a folder and run the batch against it (changing the directory names to reflect yours). Copy and paste to notepad and save as filename.bat. You may then properly run DISM on the drivers.

This has been tested on nVidia and ATI...working.

REM @echo off
REM Batch file for conversion/expansion of any driver files that do not cooperate with Windows 7 DISM ADD-DRIVER due to compression.
REM This will also parse subdirectories and expand those files as well.
REM For visual confirmation, be sure to refresh your directory to view correct file sizes.

REM Location of original driver directory	                                (user defined, don't forget trailing backslash)
SET DRVDIR=E:\VISTA\DRIVERS\nvidia

REM Wildcard pattern to search for compressed files		(this example for nvidia, NVAPI.DL_)
SET WILDCARD=*.??_

REM Holds directory\filename of original compressed files 	(user defined, may be left unchanged)
SET DRIVERS=C:\DRVORG.TXT

REM Holds directory\filename of expanded files		(user defined, may be left unchanged)
SET EXPANDED=C:\DRVEXP.TXT

REM Creates log of commands
SET LOG=C:\COOLLOG.TXT

REM Pre-Cleanup
DEL %EXPANDED% /q
DEL %DRIVERS% /q
DEL %LOG% /q

REM  Creates standard text file with directory\filename of compressed files
for /f "tokens=1,2,3,4,5 delims= " %%A in ('dir /b /s %DRVDIR%%WILDCARD%') do echo %%A >> %DRIVERS%

REM  Creates second standard text file with directory\filename of expanded files (minus the third ext character (underscore))
for /f "tokens=1,2,3,4,5 delims=_" %%A in ('dir /b /s %DRVDIR%%WILDCARD%') do echo %%A >> %EXPANDED%

REM Expands files to same directory (expanded files now have only two character extension)
for /f "tokens=1,2,3,4,5 delims= " %%A in ('type %DRIVERS%') do EXPAND.EXE -R %%A >> %LOG%

REM Overwrites original files
for /f "tokens=1,2,3,4,5 delims= " %%A in ('type %EXPANDED%') do MOVE /Y %%A %%A_ >> %LOG%

REM Cleanup
DEL %EXPANDED% /q
DEL %DRIVERS% /q

REM Present log file
CALL NOTEPAD.EXE %LOG%

EXIT

Last edited by razormoon (2009-08-29 09:04:08)

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Added "code" tags.
Very nice. wink

Re: Proper driver prepping for W7

Thanks for the tags pants smile

In any case, this is a known issue as reported on TechNet. I have been trying the expand thing with no luck until a user there suggested expanding and leaving the underscore. Genius! Hopes this helps those that come across this issue.

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Hi Razormoon,

you script does not work for me. I have thought about it quite some time and I think I know why.
The file DRVEXP.TXT only contains entries like this after running your script:

Z:\Installation\AIW

I did not know why it did not contain the correct path to the driverfiles and I think I know why. The path to my driverfiles looks like this:

Z:\Installation\AIW_Base\AIW5\AIW5_Source\Drivers_Source

Do you see the underscore in the foldernames ?
I guess thats why your script does not work for me.

Any ideas ? :-)
Thanks,
Alex

Re: Proper driver prepping for W7

Yes, the delims is putting a wrench in the batch. Fantastic stuff Alex, I'll probably leave the batch and put something together in code.


EDIT: Thinking of making this super silent and maybe you can integrate it into a script. I'll use an ini for directory pointer. Yes?

Last edited by razormoon (2009-08-30 08:36:22)

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

I have coded a new decompressor...hopefully this will get rid of nasties the likes of which midi found.
All I need to know now is how to u/l! smile





EDIT: Try this link: http://cid-8977a3dbe8c60076.skydrive.li … RVPREP.exe

Last edited by razormoon (2009-08-31 13:23:58)

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Hi Razormoon,

thanks, seems to work fine now. I especially like that the tool also works silently if the driverdir has been specified once. I guess there is no problem running the tool on a driverdir with already expanded drivers ?

Bye,
Alex

Re: Proper driver prepping for W7

No sweat. It works great with already expanded files.

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Source code razormoon? wink

Re: Proper driver prepping for W7

future.siginet?

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: Proper driver prepping for W7

This is a compiled autoit (non macro). I didn't think it warranted pascal - which is the only language I code in. However, if you find it would be useful in delphi, I'll see if I have some time to port over. If it's even worth it...?

I can probably open it up to accept command lines and you can just include it in whatever you're working on. Either way pants.

Let me know.

smile

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Oh, I didn't realize you transitioned to autoit from batch. 
*offtopic,
I've been struggling with my own oemscan project and getting it to output to a logfile from batch.

Re: Proper driver prepping for W7

Not too off topic, but when a batch starts hitting a brick wall I usually run to vba or autoit since it's simple file manipulation. For more severe projects I'll to delphi. If you need help with those batches let me know.

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Hi Razormoon,

would it be too much to ask to modify your app to accept the driverpath on the commandline instead of using that ini file ? I´d like to keep my scripts totally independent of location in the filesystem so I query the current path whenever possible and then use that in a variable.

Just do it if it is easy to implement, thanks !

Bye,
Alex

Re: Proper driver prepping for W7

I'll keep it the way it is for non-command line. As long as you feed it a path, I don't see why it shouldn't work this way. I will work on it today. It is very easy to do. Will let you know.

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

This is done. Use link above and let me know if works out.

NOTE: You must enclose directory in commandline in double quotes. "C:\MY DRIVERS" Trailing backslash optional.

Last edited by razormoon (2009-09-02 12:40:18)

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Hi Razormoon,

thanks for doing this, seems to work fine.
Bye,
Alex

Re: Proper driver prepping for W7

Good to hear. Let me know if you think of anything else.

As a side note, nothing was as frustrating as trying to figure out why DISM kept failing. I have my xbox360 controller drivers, an infrared remote receiver device (non-MS) and soundmax hd audio which all integrated without incident using DISM. It just so happens that what these three had in common were no files ending in underscore (compressed). Even after decompression it was a no go to which later on I found that the uncompressed file had to retain the underscore.

I'll be more than happy to help with driverpacks if I find the time. Please let me know.

Last edited by razormoon (2009-09-03 12:46:35)

The following sentence is false.
The preceding sentence is true.

Re: Proper driver prepping for W7

Help? yes please.
As said before, we can use all help we can get.
Especialy with the Vista / 7 drivers.