Inject Drivers into Windows PE 2.0

This tutorial assumes that you’re running Windows Deployment Services and want to update the default BOOT.WIM file to enhance platform compatibility, but the processes for injecting extra drivers into a WIM file are exactly the same for ANY WIM-based image.

You’ll need a full install of the WAIK, as it contains the necessary tools to manage WIM files. This can be done on any system, but if you’re running WDS it will install properly on the WDS server. Insert the DVD and select “Windows AIK Setup” and install WAIK.

Next you’ll need to create a folder to easily modify BOOT.WIM. I found it easiest to create a Temp folder, and then two more folders within that called Mount and Drivers. Then copy BOOT.WIM from the Vista DVD to the TEMP folder and rename it CUSTOMBOOT.WIM.

Now download the drivers you need, and extract them to \Temp\Drivers.

You’re not after DOS drivers – remember that this is Windows PE 2.0 so XP drivers are the best ones to use (or Windows Vista, if they’re available).

WinRAR is a great tool for extracting the contents of an EXE while maintaining the folder structure – this is very important as you need to be able to get at the INF driver files.

Once that’s done, go to the Start Menu, Microsoft Windows AIK, Windows PE Tools Command Prompt. This loads a command window with the PE tools IMAGEX, PEIMG and OSCDIMG loaded into the path, which makes life much easier.

Navigate to \Temp and type in:

imagex /info DRIVE:\Temp\customboot.wim

Where DRIVE is the appropriate drive letter. This checks the CUSTOMBOOT.WIM file and lists the images contained within it.

There are actually two images, but the one we want is the Longhorn Setup image – number 2. Now type in:

imagex /mountrw DRIVE:\Temp\customboot.wim 2 DRIVE:\Temp\Mount

This mounts image 2 of CUSTOMBOOT.WIM into the \Temp\Mount folder in read/write mode. You can navigate to this folder and browse the contents and make any changes you like.

Now go back to the command window and type in:

peimg /inf=DRIVE:\Temp\Driver\FOLDER\*.inf /image=DRIVE:\Temp\Mount

Where FOLDER is the appropriate folder which contains the INF driver files. This injects the drivers straight into the mounted image. You can manually specify which driver is to be installed, or just use the wildcard to install all the drivers found in that folder. Repeat this process for all the drivers you want to install.

Once that’s done, type in:

imagex /unmount /commit DRIVE:\Temp\Mount

This unmounts the image from the \Temp\Mount folder and commits the changes you made. Do NOT forget the /commit statement or you’ll have to do the whole thing all over again. Not fun.

Now go back to the WDS console and right-click on the boot image, then select Disable. Right-click again and select Replace Image, then browse to \Temp\CUSTOMBOOT.WIM. This will replace the contents of BOOT.WIM with the updated CUSTOMBOOT.WIM. It doesn’t erase BOOT.WIM, and the boot image will still use the original file, but the extra drivers are now loaded into the Longhorn Setup image. Being able to replace the image means that you can maintain an offline master boot image, so you never need to directly work with the WDS boot image.

Unlike RIS where any such change required a restart of the service, WDS accepts this change on the fly. Connect your clients to the WDS server and they will use the updated setup image with the incorporated drivers. In my setup, both problematic platforms worked perfectly with the custom boot image.

News Source: www.apcmag.com

Written by Odd-Magne Kristoffersen on November 15th, 2007 with comments disabled.
Read more articles on News.

Related articles

Comments disabled

Comments on this article have been disabled.