Updating a WIM Image File using Offline Updates
Below is a guide on how to carry this out and a list of downloads that you will require.
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’ll 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:
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 update – 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.
Once all your updates have been downloaded, you should then continue with the next stage of the process.
Download the Windows Automated Installation Kit for Windows 7 from the link above and install on your machine. This will install a file called “DISM.exe” – this is a command line program that we will use to mount the WIM, inject the updates and then unmount the WIM file.
You should then copy your custom WIM file to a location on your machine, for this guide, we’ll use “D:WIM”.
You then need to create a temporary directory that will be used to mount the WIM image, we’ll go ahead and use “D:WIMTEMP”.
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:WIMwim.wim /mountdir:D:WIMTEMP /index:2 <br />
Please remember to change “wim.wim” to the name of your own custom WIM file.
The index:2 part of the command at the end is very important as this is the index number of the image you will be mounting. You can ensure you are using the correct index number by running the following command:
dism /get-wiminfo /wimfile:D:WIMwimname.wim <br />
Once you have mounted your custom 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:
D:WSUSclientw61-x64glb <br />
When you are in the correct working directory, run the following command:
dism /image:"D:WIMTEMP" /Add-Package /PackagePath:"D:WSUSclientw61-x64glb" <br />
This command will step through each update file in the directory, adding the update to the currently mounted WIM file.
When this has completed injected all the required updates into your custom WIM, you should then run the following command to commit the changes and unmount the WIM image.
dism /unmount-wim /mountdir:D:WIMTEMP /commit <br />
This will go through the unmount process and commit the updates to your custom WIM. This can then be redistributed using your SCCM environment.
If you have any problems with this, please leave a comment below.