I often get asked by friends to re-install their computers and in return, they often offer dinner and wine in return… Sweet deal I think. Installing Windows doesn’t take very long but the patching-reboot-patching-reboot take hours and I prefer sitting at the dinner table than in front of the computer. At work, I can just leave the computer running and we also have MDT/WSUS to speed up things so I can create a full patched reference image, but not possible here. So I asked myself:
There has to be a way to create a thin, almost fully patched, Windows reference image with not a lot of effort and without infrastructure such as VMs/MDT/WSUS… How?
This is how I do it just using my laptop… It doesn’t include all patches but many and the reason for this is that some patches simply can’t be applied offline and some of them are dependent on other patches.
Before you start, make sure you have plenty of diskspace to hold all the ISOs, patches and temporary space for creating your image files. A comment on this post mentioned close to 20 GB free.
Get the patches
First, we need to get all the patches for the OS you’re installing. One way is to use WSUS and get the patches from the WSUSContent folder. But we don’t have WSUS. Another way is to install a client, run Windows Update manually and start writing down all patches that will be installed and manually download them from Microsoft Update Catalog. But for Windows 7 x64 that would be some 100+ patches and doing it manually would take too much time.
Introducing WSUS Offline Update. Download it here, extract to C:\wsusoffline and run UpdateGenerator.exe.
Select the OS you’re installing, in my case Windows 7 x64 Global and click Start. It will now download all patches locally, in my case C:\wsusoffline\client\w61-x64\glb (1.9 GB, 131 files).
Done! Now you have all the patches for the OS you’re installing.
Patch that image
Get the Windows ISO/DVD. Copy .\sources\install.wim to C:\Extract\sources\install.wim. Mount the file using the following command. If you don’t have dism already, you can get it from the Windows AIK download.
dism /mount-wim /wimfile:C:\Extract\sources\install.wim /mountdir:C:\dismmount /index:3
Run the following to add all patches from the above WSUS Offline Update to the image:
IMPORTAMT: If you’re offline patching Windows 7, make sure to remove KB2506143 and KB2533552 from the patch directory first since this update breaks the installation. A comment on this blog also says to remove KB2819745.
dism /image:C:\dismmount /Add-Package /PackagePath:C:\wsusoffline\client\w61-x64\glb
You will get some errors for certain patches and this is normal. Some patches simply can’t be added in offline mode so they have to be installed manually afterwards, but in my case, 118 out of 128 could be added which saves me a lot of time anyway. Example of an error message:
If you got the following, you didn’t read my instructions above carefully since this and another patch can’t be added offline:
Package Package_for_KB2533552 may have failed due pending updates to servicing components in the image. Try the command again.The specified package is not applicable to this image.
Once done, you need to commmit the changes:
dism /unmount-wim /mountdir:C:\dismmount /commit
Prepare the installation media
Now, just replace install.wim on the media you’re installing from. I prefer making a bootable USB stick using this guide. Get a fast one, like the Kingston DataTraveler R3.0 and you’ll save even more time.
Once installed you’ll notice you have a lot fewer patches to install. Now go ahead and enjoy more time with your friends instead of sitting in front of the screen watching Windows Update…
Some other stuff…
Here are some other useful dism command lines:
If you made an error, you can simply discard your changes:
dism /unmount-wim /mountdir:C:\dismmount /discard
You can get which packages and features installed on the image:
dism /image:C:\dismmount /Get-Packages
dism /image:C:\dismmount /Get-Features
Why index 3? Well, you can get the different indexes by running the following command:
dism /get-wiminfo /wimfile:C:\Extract\sources\install.wim
Please comment on how you quickly reinstall your friend’s computers so you can spend more time at the dinner table with them rather than in front of the computer.
You need to remove KB2819745 otherwise you get the same issue.
Thank you so very much for providing this step by step process, I had only recently asked MSFT if they had an available fully patched download or disk for WIN7x64 Home Premium, they of course did not. I was not happy looking at that day of patching and so I started a search online for just what you offered. This search took me less than 2 minutes to find your website and basically saved my XMAS. My intent is to rebuild my Sisters computer and my Sons with new SSD drives and I knew I was going to lose the weekend in the effort.
the piece of information you may have missed is the need for 20+ Gig of space to build the image into the Dismmount folder. I was lucky to plan ahead for that and had plenty of space on my own SSD.
I used copy and paste from your own webpage and found that it worked perfectly, my biggest delay was hunting for the risky KB files that you had recommended I remove, I only found one of them.
Now I just need to backup all my Sisters important stuff and take note of the many installed applications she has before gifting her with a brand new SSD, Memory upgrade, and new video card.
MERRY XMAS to you and your team of IT Ninjas, Happy New Year.
Terry
Hey there, very nice article. I have a question for you, does this process work for you if you try to add update packages to a Windows 7+SP1 install.wim? I am having the absolute worst luck using dism to add updates to my install.wim. I have removed the two updates you mention here specifically and I even deleted all IE9, IE10, and IE11 packages from the wsusoffline client folder, that still leaves about 143 updates and around 10 of those always fail (which you also mention is normal). The whole process works fine until I try to boot the laptop I install the image on. I get a nasty popup message saying that the Windows install cannot be completed and to reboot, which only pops up the message again. So basically, using dism exactly as described is not working at all for me. I’m hoping you have run into similar issues in the past and maybe have a suggestion for me?
I really wish Microsoft would just issue an SP2 for Windows 7 but that’s not going to happen.
Hopefully Microsoft will learn and in the future, they might even have a fullt patched WIM online *always* so we don’t have to create our own WIM-files from time to time.
Great pointing out the diskspace, I will add that to the article!
I usually download the “Windows 7 with SP1” ISO and start from there. Maybe this will help? I know IE usually creates problems so you often have to add that afterwards.
Thanks! I’ll add that KB to the list.
Also remove KB3042058.
I am having issues , first was caused by the wrong Index i needed 1
Now have the wim mounted
But keep getting errors unable to access the image
All the paths are correct, but i feel something is missing from “dismount” folder Error2
any suggestions
If you have a Windows 7 DVD without SP1 how to do you include SP1. I followed your steps and it works perfectly on Windows 8.1
When I try with Windows 7 without Sp1 it only seem to apply the patches up to SP1 but SP1 doesn’t seem to be able to be done in offline mode.
Remove KB3172605
I did not remove any patch/fix as advice, because I want try and error to see which 1 really cause error for me. This 3 patch/fix are the one that fail, KB2533552 KB3042058 KB3172605.
(I download update via wsus offline and tick the option to download security fixes only instead of quality rollup, like this we just can see what updates are included inside of the roll up and able to remove them 1 by 1.)
Thanks for your posting, it is very helpful. Please update it with all the additional “breaking” patches, which can’t be added offline.
What I don’t get: Even with a completely up-to-date wsusoffline and all the above steps I have to install 77 important and 3 optional updates from Windows Update after the installation from a DISMed Win7Pro-DVD.
What’s wrong?
I received the same error, but concerning KB4019990.
Thanks for the guide. Nice way to update W7 SP1 without all the hassle. You can exclude certain updates by creating a “ExcludeList.txt” and a “ExcludeListForce-all.txt” and placing the updates you want to skip inside each of the text files. Format the updates you want to skip with kb in lower case and a single update per line then copy both text files to:
\wsusoffline\exclude\custom
I’ve added these to mine:
kb971033
kb2505438
kb2533552
kb2670838
kb2882822
kb2902907
kb2952664
kb2976978
kb2976987
kb2977759
kb2990214
kb2999226
kb3012973
kb3013791
kb3015249
kb3018467
kb3021917
kb3022345
kb3029432
kb3029603
kb3029606
kb3035583
kb3041857
kb3042058
kb3044374
kb3044374
kb3045634
kb3045746
kb3046480
kb3050265
kb3050267
kb3053863
kb3054256
kb3054464
kb3055323
kb3055343
kb3056347
kb3058168
kb3059316
kb3060383
kb3060746
kb3060793
kb3061493
kb3063843
kb3064059
kb3064683
kb3065013
kb3065987
kb3065988
kb3068707
kb3068708
kb3071663
kb3072019
kb3072318
kb3074677
kb3075249
kb3075851
kb3075853
kb3078405
kb3078676
kb3079318
kb3080042
kb3080149
kb3080800
kb3081437
kb3081454
kb3081954
kb3083324
kb3083325
kb3083710
kb3083711
kb3084905
kb3086255
kb3087041
kb3087137
kb3088195
kb3090045
kb3091297
kb3092627
kb3093983
kb3095701
kb3096433
kb3099834
kb3100919
kb3100956
kb3102429
kb3102810
kb3102812
kb3103696
kb3103699
kb3107998
kb3112148
kb3112336
kb3112343
kb3118401
kb3121255
kb3121260
kb3121261
kb3123242
kb3123303
kb3123862
kb3124280
kb3125210
kb3126030
kb3126033
kb3128650
kb3130896
kb3132080
kb3133924
kb3133977
kb3134815
kb3135445
kb3135449
kb3138612
kb3138615
kb3139921
kb3139923
kb3139929
kb3146449
kb3148198
kb3150513
kb3161102
kb3161608
kb3163589
kb3170735
kb3172605
kb3173040
kb3184143
kb4019990
kb4462949
kb454826
wsus won’t download or install them now ;