This guide is meant to be a quick, fun guide to injecting drivers into a Windows image using a Surface Pro as an example target machine. I was unable to find a concise source of information on how to do this without getting an in depth lesson on the Windows ADK, or DISM, so I figured I'd introduce myself with a guide that I hope many will find helpful.
Before we get started, please make sure you are complying with the license agreement associated with the version of Windows you choose to work with.
The one tool we'll need to use in the Windows ADK is DISM. We're not going to dive into any of the other components of the Windows ADK quite yet.
After installing the Windows ADK on your technician computer, you'll need to mount your Windows installation media and copy the install.wim file to a local directory. Windows 8+ has built in ISO mounting, though if you're on Windows 7, feel free to use your favorite ISO mounter (Virtual CloneDrive, Daemon Tools, etc.). In this example, the Windows 8.1 ISO is mounted to F:\. The install.wim file is located in the sources directory, F:\sources in this case. Copy the install.wim file to your local hard drive, I'm using C:\images to store the ISO, drivers, and install.wim file.
The next step is identifying which version of Windows we would like to inject the drivers into. We're using a Windows 8.1 ISO, which contains two versions of Windows 8.1: Windows 8.1 and Windows 8.1 Pro. We'll be working with the Windows 8.1 Pro image.
On your Technician Computer, open the Deployment and Imaging Tools Environment as Administrator. To do this in Windows 8.1, press the Windows key, type deployment, select the Deployment and Imaging Tools Environment icon, and either right click and select "Run as Administrator" or press Ctrl+Shift+Enter. You should see a window that resembles the following:
We must first identify which edition of Windows we wish to work with. The following command will tell us more information about our install.wim file:
> Dism /Get-WimInfo /WimFile:C:\images\install.wim
In our case, we want to use Windows 8.1 Pro, Index 1.
In order to work with the WIM file, you'll have to mount it. Create a new directory for mounting your WIM, I'm using C:\images\wim_mount. Mount your WIM file with the following command:
> Dism /Mount-Wim /WimFile:C:\images\install.wim /Index:1 /MountDir:C:\images\wim_mount
Next, you'll have to collect the hardware specific drivers you wish to inject into your Windows installation. The Surface Pro Firmware and Driver pack includes everything we need and can be downloaded at: http://www.microsoft.com/en-us/download/details.aspx?id=38826. I extracted the driver package to C:\images\February2014SurfacePro2.
To inject drivers into the WIM file, use the following command:
> Dism /Image:C:\images\wim_mount /Add-Driver /Driver:C:\images\February2014SurfacePro2 /Recurse
You can also add individual drivers by omitting the /Recurse option in the command above and pointing it to a specific .INF file as such:
> Dism /Image:C:\images\wim_mount /Add-Driver /Driver:C:\images\February2014SurfacePro2/testDriver.INF
I always think it's a good practice to confirm that the drivers were added. Use the following command to get information on 3rd party drivers added:
> Dism /Image:C:\images\wim_mount /Get-Drivers
Once you've successfully injected the drivers and confirmed they're there, you must now commit the changes and unmount the WIM. The following command does exactly that:
> Dism /Unmount-Wim /MountDir:C:\images\wim_mount /Commit
Congratulations, you're (mostly) done! Now that you have a nice, new, driver-injected WIM file, you have options for deployment. You can throw it at your SCCM/WDS server and deploy it that way, or you could put it on a flash drive. I'll write up a quick blog post about preparing USB media for Windows installation as a follow up to this.
For those who don't want to read the wall of text above, here's the "too long; didn't read" version:
Windows ADK Documentation - http://technet.microsoft.com/en-us/library/hh824947.aspx
Windows ADK Download - http://go.microsoft.com/fwlink/p/?LinkID=293840
Add and Remove Drivers Offline (DISM) - http://technet.microsoft.com/en-us/library/dd744355(v=WS.10).aspx
Surface Pro Firmware and Driver pack - http://www.microsoft.com/en-us/download/details.aspx?id=38826
Very nice - just created the new install.wim and can't wait to try it on my pro3.