This script is triggered the first time a user login (preferred the admin, otherwise it might not work due to missing admin rights). It will then check multiple drives and if there exists a firstrun.bat (which we will create later) it will run the batch file.

2d.) Then go to "C:\Update_Windows_7_Image\Extracted\source\$OEM$" and create an folder called "$1". Everything inside that folder will be copied to the root drive where MS Windows will be installed.

2e.) Inside that folder (C:\Update_Windows_7_Image\Extracted\source\$OEM$\$1) create a new folder called FirstRun and inside that a file called FirstRun.bat with the following content:

@Echo Off

3.) As the *.MSU files are nothing else as a kind of ZIP files we will extract them now at first, so that this step must not be done later one during the integration. This often speeds up the installation. The following powershell script will do that

5.) Depending on which version we wish to "update" we need to use the correct index. In this example here we will update all versions in the image, so we will use a batch script which runs true all 5 indexes above and performs the same step for all of them (this will not result in a very big file).

If your install.wim showed only 4 indexes, then remove the nr 5 from the 4rd line in the script below.

So create a empty CMD named "integrate_updates.cmd" inside C:\Update_Windows_7_Image with the following content:

Note: It would be possible to download all *.CAB files from a fresh installed Windows 7 OS from the folder C:\Windows\SoftwareDistribution\Download\ and put them into C:\Update_Windows_7_Image\PendingWindowsUpdates. But as Microsoft sometimes re-release hotfixes and the fact that the cleanup agent might delete these files, it should be a fresh installed Windows OS where you fetch the files from.

If something failed you can run dism /unmount-wim /mountdir:C:\Update_Windows_7_Image\Mounted /Discard

6.) Optional: As the image we are working on is include multiple versions from Windows but do not allow us to choose the version we need during the installation (e.g. Choose ultimate or professional) we will adjust that now, so that we can choose the version during the next installation. To enable the additional dialog the optional ei.cfg in the source folder (C:\Update_Windows_7_Image\Extracted\sources) [see here for more infos] must be deleted. If that file is no longer exists an additional dialog box appears during installation and will ask us to choose the Windows version we need. This might be useful if you own multiple PCs and wish to install MS Windows 7 Home on one PC and Ultimate on the other. So this change here would switch the installation image into a kind of "universal installation disk".

Keep noted that you still need the correct activation key. If you have an Windows 7 Home key, it will not work when you choose ultimate during the installation and via versa.

7.) Inside our still open CMD we will run the script now via:

C:\Update_Windows_7_Image\integrate_updates.cmd

Depending on your PC this might take a while. Keep noted that you should not open the explorer and browse the folders for that project here as that might cause issues in the DISM process!

Which will import all our updates now into the image. Depending on the amount of updates and performance from your PC this might take some time.

8.) Optional: There are some updates which couldn´t be imported via the method above. If you try that (also via the script above) you will get multiple error messages via DISM like:

The specified package cannot be added to an offline image.Add this package to a running operating system using the /Online option. Error: 0x800f082e

Those updates are the following (feel free to share your solution or others updates which are causing issues in the comments):

- KB2533552

To include these updates in our Windows 7 installation image we need to perform the following:

8a.) Download the *.msu files and store them inside the following folder (C:\Update_Windows_7_Image\Extracted\$OEM$\$1\FirstRun\Updates).

8b.) Now edit our FirstRun.bat (not the FirstRun.cmd) and for each of the updates which couldn´t be installed enter a similar line as below:

The %~dp0 (that’s a zero) variable, when referenced within a Windows batch file, will expand to the drive letter and path of that batch file

9.) Optional: Via the FirstRun.bat you can now also install the latest .net Framework (for example 4.7). Simply add the following lines to the FirstRun.cmd and store the .net Framework 4.7 installer (NDP47-KB3186497-x86-x64-AllOS-ENU.exe) inside the folder C:\Update_Windows_7_Image\Extracted\$OEM$\$1\FirstRun\netFrameworkUpdate

10.) Optional: Via the FirstRun.bat you can now also install the latestManagement Framework (for example 5.0) as this required an .net Framework 4.5. or higher, which you just installed. Simply add the following lines to the FirstRun.cmd and store the .net Framework 4.7 installer (Win7AndW2K8R2-KB3191566-x64.msu) inside the folder C:\Update_Windows_7_Image\Extracted\$OEM$\$1\FirstRun\netFrameworkUpdate

11.) Optional: Out of the box the FirstRun.cmd isn´t triggered. So inside the C:\Update_Windows_7_Image\Extracted folder we need to create now a autounattend.xml with the following content:

12.) Optional: If you perform the tasks here multiple times over and over you might recognize that your image will grow in size. To change that you need to export the image in order to see a change/reduction in the file size. During the export process, DISM removes files that were superseded. Additional you can also specify the compress option (default is fast) and use maximum here.

If you do not use the AIK 8.1 folder, then DISM will have the version 6.1.7600.16385 which do not have this feature and will cause an error 87!

To do that we export every index to the new image. So save the following to C:\Update_Windows_7_Image\compress_image.ps1 and run it.

If you shrink the image you can also export only one index (for example index 4, the ultimate version)

In that example here it decrease the needed space from 4.9GB to 4.3GB which will allow us again to burn the image on a normal DVD.

13.) We can then delete the original C:\Update_Windows_7_Image\Extracted\sources\install.wim and rename our install-NEW.wim to install.wim (or better move that to a backup place, but remove that from the extracted folder!).

14.) After that we will create our new ISO (so create an folder called "ISO" inside "C:\Update_Windows_7_Image"). So switch to the OSCDimg folder (C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg). Inside that folder run the following command:

Hey, I am trying to make a slipstream with all win 7 version in one iso, not only one version, i saw dism++ a gui for dism for windows. I wan to update all version to the iso so when i select a version is it updated and ready.

Can i do that for...

Hey, I am trying to make a slipstream with all win 7 version in one iso, not only one version, i saw dism++ a gui for dism for windows. I wan to update all version to the iso so when i select a version is it updated and ready.

Can i do that for all version o do i have to make iso of each version? thanks