DISM Add-Package, Updates, Windows 7 Deployment and I
So, how to slipstream updates to a Windows 7 image??? What a lovely quest I was on there 😀
In the old days, it was called slipstreaming updates and service packs into Windows images. But no more – Now it’s called servicing an offline image by adding packages! Oh my xxx, that is annoying. Anyway, in Windows 7 we have the wonderful tool dism.exe – It’s command-line only at the moment, but I read somewhere that MS is working on a GUI-version of the tool. Joy?
UPDATED 6 May 2010: Added Add-Drivers (+ expand-section)
First, you need to have some folders on your harddrive, I have:
Next, I have my image-file lying in C:\image, and I run all commands from that folder in a commandpromt with administrative priviledges.
- Mount your image!
dism /Mount-Wim /WimFile:Windows7_20100330.wim /index:1 /MountDir:mount
- Apply your downloaded MSU-packages (www.microsoft.com/downloads and search for kb-numbers) one by one:
dism /image:.\mount /Add-Package /PackagePath:.\Updates\xxxxx.msu
- Apply your downloaded drivers (preferably WHQL-certified!)
dism /image:.\mount /Add-Driver /Driver:.\drivers /Recurse
- Unmount and commit the image!
dism /Unmount-Wim /MountDir:mount /commit
That’s it! The image is updated and ready to be deployed, wohoo.
Here’s some more info:
- Windows Defender update has the same KB-article number every time. It’s an EXE-file and cannot be added like other updates
- Malicious Software Removal tool has the same annoying flaws as Windows Defender (save the KB-number) and is also an EXE-file.
- You can make a batch-file: fx updateall.cmd which can enumerate all files in the updates-folder and apply them all to the mounted image. I use this:
for %%g in (.\Updates\*.msu) do dism /Image:.\mount /Add-Package /PackagePath:%%g
- Drivers in subdirectories of the C:\image\drivers-folder are already applied recursively because of the /recurse-switch. So it doesn’t matter that you seperate all drivertypes into subfolders named fx; lan, wlan, audio, video and so on.
- Regarding drivers, you might have to use the expand-command to expand files ending with an underscore. Expand to a temporary directory, then take those files and replace them with the originals. (You might notice larger filesizes on the expanded files in the temporary directory). Here’s the command:
expand *.*_ C:\image\temp (I don’t know if you have to create the temp-folder first.)
Thanks for reading! Hope you can use it!