With Windows 7 being a number of years old now, when you rebuild a Windows 7 machine you will find that there are 200+ Windows Updates that need to be applied to your installation.
So what if you could add all those updates into your Windows 7 installation source media so that they are applied during the installation and saving you time having to run them after the install?
STAGE 1 – Download required offline Windows Updates
Download the WSUS Offline Tool from the link above and extract the zip file to a directory on your computer – for this guide purposes, we will use “D:\WSUS” (although most people will use a C: drive location).
Run the “UpdateGenerator.exe” file located in the root of extracted files.
You will be presented with a program and you can select the versions of Windows, Office and Legacy products that you wish to update. Remember to include (or exclude) the x86 and x64 versions if you want to update these different architectures.
You also have the option to use a WSUS server on your local network to retrieve the Windows Updates from (this is much quicker if you have a slower internet connection). To do this, click the WSUS button at the bottom and enter the URL of your WSUS server:
If you wish to download all the available updates from Windows Update server, do not enter any information into this setting.
Once you have selected all the options that you want to download updates for, press the Start button at the bottom left. A command box will appear and will start to download all the required updates – this can take a long time depending on your selections and internet speed. These updates will be copied into the folder structure of the extracted files (“D:\WSUS”).
Please note that although the first set of downloads will take a while, you can then run this process again at a later date and it will only download any newer updates required. This way you can keep an up to date repository of offline Windows Updates.
Once all your updates have been downloaded, you should then continue with the next stage of the process.
STAGE 2 – Injecting the offline updates into your Windows 7 installation source media
To carry this out, you need to update the “install.wim” file that is contained within your Windows 7 installation media. To do this, you can either copy all the files from your DVD or extract the files from your ISO file. Once you have the source files you should copy them to your local disk, for this demo we will use “D:\WIM”.
Note that your “install.wim” file is in the following location of your Windows 7 installation media:
You then need to create a temporary directory that will be used to mount the WIM image, we will go ahead and use “D:\WIM\TEMP”.
You then need to ensure that you use the correct index number by running the following command:
dism /get-wiminfo /wimfile:D:\WIM\source\install.wim
As you can see from the above image, the index we need to use for this process is “index:2” – however this can change depending on how you have created or captured your WIM file so you should always check this first before trying to mount a WIM file. Standard Windows 7 OEM media is usually index 1.
You then need to open an elevated administrative command prompt and then run the following command to mount the WIM file to your earlier created temporary location:
dism /mount-wim /wimfile:D:\WIM\source\install.wim /mountdir:D:\WIM\TEMP /index:2
Once you have mounted your WIM, you then need to go into the correct directory within your earlier downloaded updates for your WIM file. So, if your WIM file is Windows 7 x64, you should go to:
If your WIM file is Windows 7 x86, you should go to:
If your WIM file is Windows 8.1 x64 you should go to:
When you are in the correct working directory, run the following command:
dism /image:"D:WIM\TEMP" /Add-Package /PackagePath:"D:\WSUS\client\w61-x64\glb"
Note that the above command is for Windows 7 x64 – change the PackagePath as required for the operating system you are trying to update.
This command will step through each update file in the directory, adding the update to the currently mounted WIM file.
When this has completely injected all the required updates into your WIM, you should then run the following command to commit the changes and unmount the WIM image.
dism /unmount-wim /mountdir:D:\WIM\TEMP /commit
This will go through the unmount process and commit the updates to your custom WIM.
If you get an error at all once the commit process has completed then run the following command:
Once this is completed you can then use these source files to create a new DVD installation media or USB installation media.
If you have any problems with this or have any questions at all, please use our comments system below.