GUIDE: Integrating Windows 7 post-sp1 updates to installation disk (64-bit)

Discussion in 'Windows 7' started by harkaz, Jan 22, 2013.

  1. harkaz

    harkaz MDL Novice

    Dec 27, 2012
    #1 harkaz, Jan 22, 2013
    Last edited: Aug 24, 2013
    GUIDE: Integrating Windows 7 post-sp1 updates to installation disk (64-bit)

    This tutorial will show you how to integrate all post-sp1 updates to a windows 7 installation disk.

    1. What will you need

    GImageX, Windows Updates Downloader, An updated Windows Updates Downloader List (e.g. from MSFN forum), Windows 7 SP1 x64 TechNet/MSDN ISO, VMWare, any ISO editing tool, Daemon Tools Lite, Windows Automated Installation Kit (AIK) for Windows 7, Internet connection, External (USB) Hard disk Drive. Most important: 5-10 hours of free time

    If you don’t have any of the tools mentioned here, just google them and you’ll find more about them, including download links.

    2. What will you do

    You will do the following:

    • Slipstream all post-sp1 updates in the Windows Recovery Environment
    • Slipstream all post-sp1 updates in Windows Boot Image – which is loaded when you boot from Windows Installation disk
    • Slipstream all post-sp1 updates in all 4 operating system images which are all included in a single installation image file – the install.wim file.
    • Update Windows 7 Setup core files and catalogs, so that they are consistent with the integrated updates.

    3. Preparing

    1. Install Windows AIK, Windows Updates Downloader, VMWare, Deamon Tools Lite. Download and double-click the Windows Update Downloader List to install it.
    2. Click Start->All Programs->Windows Updates Downloader->Windows Updates Downloader.
    3. When Windows Updates Downloader loads check the following options and click Download.
    Downloading updates will start immediately. We will leave the window open.


    4. Let’s deal with the Windows 7 SP1 x64 ISO. We edit it in the ISO editing tool you downloaded. I use UltraISO. Open ISO in the program and delete sources\ei.cfg file. Save changes.
    5. Using daemon tools lite mount this modified ISO to a virtual drive.
    6. Open Windows AIK Deployment Tools command prompt as administrator (right-click and click “Run as Administrator”):

    Execute the commands:
    mkdir C:\mount
    dism /Mount-Wim /WimFile:L:\sources\install.wim /index:1 /MountDir:C:\mount /ReadOnly

    where L: is the drive letter of the virtual drive.

    Please wait until the install.wim image has been mounted.
    7.When mounting image is complete, open the C:\mount folder. Navigate to the Windows\system32\Recovery folder.
    8. Connect the external hdd and copy the winRE.wim file there. This is the Windows Recovery Environment image. We will slipstream updates here. Later we will add it to the installation image.
    9. Close all open Windows Explorer windows.
    10. Run these commands in command prompt:

    dism /Unmount-Wim /MountDir:C:\mount /discard
    rd C:\mount
    11. We are ready to integrate updates in winRE.wim

    4. Slipstream updates in winRE.wim

    1. Update downloading must have been completed by now. If it hasn’t, wait until it does – and close Windows Updates Downloader.
    2. Go to your Documents folder. Open the Windows Updates Downloader folder.

    3. Let’s rename the folders to something more appropriate for command prompt. Rename the Non-Security Updates to Upd1, Security Updates to Upd2, .NET Framework 3.5.1 Updates to Upd3.
    4. Move ALL folders to the external hdd. Place GimageX binaries folder to the external hdd as well.
    Supposing the drive letter of the external hdd is K:

    Run the following commands in the elevated command prompt window you have opened previously:

    mkdir C:\recmount
    dism /Mount-Wim /WimFile:K:\winRE.wim /index:1 /MountDir:C:\recmount
    dism /Image:C:\recmount /Add-Package:K:\upd1
    dism /Image:C:\recmount /Add-Package:K:\upd2

    The deployment image servicing and management tool will install all applicable updates to winRE.wim. The next step ensures minimum winRE.wim image size (if it is too big, the Windows Recovery Environment will require too much RAM space to load in the future).
    6. Cleaning up the Windows Side by Side and Update Removal Data (OPTIONAL)

    If we commit changes to the winRE.wim right now, it will take about 340 MB. That’s enormous and it will take something more than 512 MB of RAM for Windows Recovery to load properly. If you don’t care about it, proceed to step 7.
    We will delete the older versions of system files (before updates were committed) – which are backed up by default. When we finish the whole process, winRE.wim will take about 210 MB – much better.

    a) Navigate to C:\recmount\Windows\servicing\Packages
    b) Sort by date modified, in descending order.
    c) Delete ALL files modified after 21 November 2010 (when Windows 7 SP1 was originally serviced).
    d) Navigate to C:\recmount\Windows\WinSxs
    e) Sort by date modified, in descending order:

    WARNING: Deleting these files will break Windows PE servicing and you will be unable to add/remove Windows PE features. You will be also unable to install updates that supersede previous ones.

    f) Delete all files and folders newer than 21 November 2010 EXCEPT for pending.xml file, and the “Backup”, ”FileMaps”, ”Temp”, ”Catalogs”, ”Manifests” folders

    7. Close all Windows Explorer windows.
    8. Run the following commands:
    dism /Unmount-Wim /MountDir:C:\recmount /commit
    rd C:\recmount

    9. When winRE.wim has been saved, we have to rebuild it. We will use GImageX.
    10. Launch the application from the external hdd (K:\GImageX\install\x64\gimagex.exe)
    11. Select the Export tab and perform the settings shown below:

    Source: K:\winRE.wim
    Image: 1
    Destination: K:\
    Name: (leave field blank)
    Boot option ON (check box)
    Check option ON (check box)

    12. Click Export. A dialog box will appear, showing rebuild progress.
    13. When imaging operation is complete click Close at the dialog and then close the main GimageX window.
    14. In the root of your external hdd (K:\) remove the old winRE.wim
    15. Rename to winRE.wim

    You have slipstreamed all post-sp1 updates in Windows Recovery Environment!5. Slipstreaming updates in Windows Installation Image

    5. Slipstream updates in Windows installation image

    We will complete integration in 3 stages (this method is known as reverse integration):

    • Stage 1: Install all Windows versions included in the install.wim image to separate virtual machines. In the case of Windows 7 x64 there exist 4 versions in the install.wim file: Home Basic, Home Premium, Professional and Ultimate. We will install each version in a separate virtual machine. This means that we will create 4 virtual machines.
    • Stage 2: Install all post-sp1 updates and optionally some programs.
    • Stage 3: Re-create the install.wim image.

    Before you start:

    • Create 4 new virtual machines in VMWare – see its documentation for help doing this. Use Windows 7 x64 OS profile and choose “I will install the operating system later”. The 4 virtual machines should be named Windows 7 Home Basic x64, Windows 7 Home Premium x64, Windows 7 Professional x64 and Windows 7 Ultimate x64.

    • Let’s deal with the Windows 7 Home Basic x64 machine first. It is obvious that you will install Windows 7 Home Basic x64 SP1 there. The steps provided below to integrate updates in Windows 7 Home Basic are almost identical for all versions.
    • Follow this order when you configure the different Windows versions in their virtual machines: deal with Windows 7 Home Basic first, then Windows 7 Home Premium, then Windows 7 Professional and finally Windows 7 Ultimate. Make sure you complete all 3 integration stages for each virtual machine before proceeding to the next one.

    1. So, let’s start configuring each virtual machine. Start the virtual machine. Ignore any messages about VMWare Tools installation. You need to enter VMWare’s BIOS setup and change boot order so that the first boot device is CDROM. Press F2 MANY TIMES to enter BIOS setup. If you miss it the first time, immediately press Ctrl+Shift+Del to reboot the virtual machine and start pressing F2 again.
    2. When you enter BIOS Setup use the arrows to move to the Boot tab, and then select the CDROM device.
    3. Press “+” button 2 times to bring CD-ROM drive to the top of the boot list. Press F10 to save changes. Press ENTER. VMware will restart.
    4. Windows Setup will load immediately from the modified TechNet ISO you had mounted earlier.
    5. When initial window appears, just click next.
    6. Click Install Now
    7. Select the operating system to install from the list that appears.

    Select the version of Windows you want to install to the virtual machine. We will present the process for Windows 7 Home Basic x64. The steps are identical for other Windows versions.
    8. Accept the license terms
    9. Click Custom installation.
    10. Click Next at partition selection screen.
    11. Drink a cup of coffee/tea/whatever while Windows is being installed to the virtual machine.
    12. When Setup requires you to enter a computer name, press Ctrl+Shift+F3 key combination.
    13. The virtual machine will restart. Windows will enter a special mode called audit mode.
    14.When it completes loading to desktop, the following window will appear:


    Ignore the “System Preparation Tool 3.14” window for the moment – just close it. It will reappear every time you the VM is restarted in later steps. Ignore it until you are told to do something with it.
    15. If any window about selecting network type appears, just close it – it won’t appear again.
    16. Open command prompt (it will be always elevated)
    17. Attach the external hard disk drive to the virtual machine (see VMware’s documentation for details)
    18. Run the following commands:
    mkdir E:\Upd1\ext
    mkdir E:\Upd2\ext
    mkdir E:\Upd3\ext
    expand –F:* e:\upd1\*.msu e:\upd1\ext
    expand –F:* e:\upd2\*.msu e:\upd2\ext
    expand –F:* e:\upd2\*.msu e:\upd3\ext
    dism /online /Add-Package /PackagePath:E:\upd1\ext

    Note: You need to run the first six commands only on the first virtual machine you configure (the Windows 7 Home Basic one).
    19. Press Y when it completes to restart Windows.
    20. Install Windows Internet Explorer 9 – or the latest available version of IE. The Internet Explorer 9 installation msu file is located in the Optional Updates folder of the external hdd drive. When Windows restarts, launch Windows Explorer. Move internet explorer 9 install msu file to external hdd’s root.
    21. Open command prompt and run the commands:
    mkdir e:\ie_ext
    expand –F:* e:\*.msu e:\ie_ext
    dism /online /Add-Package /PackagePath:E:\ie_ext

    Note: You need to run the first 2 commands only on the first virtual machine you configure (the Windows 7 Home Basic one)
    22. Again, wait for Windows Internet Explorer 9 to be installed. Press Y to restart Windows when installation completes
    23.When Windows restarts, open command prompt and run the following commands:
    dism /online /Add-Package /PackagePath:E:\upd2\ext /norestart
    dism /online /Add-Package /PackagePath:E:\upd3\ext /norestart
    This will install security updates.
    Ignore error messages about
    24.Restart Windows again. After restart, open windows explorer and browse to E:\Optional Updates.
    25. Install the optional Windows Management Framework MSU update (if applicable) – it is the smaller of the two MSU files (just double click it). Follow instructions to install.
    26. Restart Windows again.
    27. Now launch Windows Update and check for remaining updates (Internet connection required):

    Install the Windows Update Agent update first (click Install Now).

    Wait until scanning for updates is complete. (Click “Check for Updates” if it appears again).

    Download and install all updates.

    NOTE: You can skip steps 16-26 and alternatively use Windows Update to download and install ALL updates. Remember to repeatedly scan for updates until no one shows up.
    (You MUST skip installing .NET Framework 4 profile by hiding it)

    After all updates have been installed, click Restart now to finish installing.
    28. Copy the slipstreamed winRE.wim file from E: drive to the C:\Windows\System32\Recovery folder. Replace the winRE.wim file that exists there.
    29. At this point, you can optionally install programs like .NET Framework. Perform all necessary reboots.
    30. Optionally run the large MSU file in the E:\optional Updates folder. It is the latest version of System Update Readiness Tool.
    31. Restart again. When the sysprep window appears...
    DO NOT CLOSE IT. First detach external hdd. THEN CHECK “Generalize” option, click OK.

    BE READY FOR SYSTEM RESTART! When system restarts boot immediately from Windows installation disk (press any key when the “Press any key to boot from CD or DVD” message appears).

    32. When Windows Setup loads click next.
    33. Click “Repair your computer”
    34. When the System Recovery Options message appears click No
    35. Click Next. At the Windows Recovery Options Dialog click “Command Prompt”.
    36. Attach the external hdd to the virtual machine.
    37.At command prompt type “notepad” and press ENTER.
    38. We will use notepad’s Open File Dialog (click File, Open) to view files in explorer-style. – Let’s cleanup all log files
    a) Set Files of Type to All Files, to show all file types in Notepad's open file dialog.
    b) Click the “computer” button on the left pane of the open dialog. Open the D: volume (where Windows is installed)
    c) Browse to \Windows folder. Delete the TSSysprep.log and WindowsUpdate.log files (select them one at a time and press Shift+Del).
    d) Then, while you are in the Windows folder, open the Logs\CBS folder and delete the CBS.log file there.
    e) Then return to the Windows folder. Open the \Panther folder. Delete everything in there.
    f)Return to \Windows folder. Open the \system32\sysprep folder.
    g) Delete the Sysprep_succeeded.tag file. Then open the Panther folder and delete everything in there.
    You have deleted all the log files. Close Open dialog and then close notepad.
    39. Reset original WPA configuration: System Preparation Tool resets the original 30-day activation grace period. This reduces the remaining number of such resets. We will undo this change right now
    At the command prompt type:
    reg load HKLM\MY_SYSTEM “D:\Windows\System32\config\SYSTEM”
    reg delete HKLM\MY_SYSTEM\WPA /f
    reg unload HKLM\MY_SYSTEM

    40. Re-Capture operating system install image with GImageX:
    a) Open notepad and browse to “My Computer” as shown in steps 38a, 38b
    b) Open the External hdd (drive f: )
    c) Open GIMagex folder.
    d) Proceed in the subfolders until you find the x64 version of GImageX
    e) To launch it, right click it and click “Run as Administrator”.
    f) GImageX Window will appear.
    g) The settings you will select now depend on which virtual machine OS you configure:

    • Windows 7 Home Basic x64 settings:

    Source: D:
    Destination: F:\install.wim
    Name: Windows 7 HOMEBASIC
    Description: Windows 7 Home Basic
    Compression: Maximum
    Display Name: Windows 7 Home Basic
    Display Desc.: Windows 7 Home Basic

    • Windows 7 Home Premium x64 settings:

    Source: D:
    Destination: F:\install.wim
    Name: Windows 7 HOMEPREMIUM
    Description: Windows 7 Home Premium
    Compression: Maximum
    Display Name: Windows 7 Home Premium
    Display Desc.: Windows 7 Home Premium

    • Windows 7 Professional x64 settings:

    Source: D:
    Destination: F:\install.wim
    Name: Windows 7 PROFESSIONAL
    Description: Windows 7 Professional
    Compression: Maximum
    Display Name: Windows 7 Professional
    Display Desc.: Windows 7 Professional

    • Windows 7 Ultimate x64 settings:

    Source: D:
    Destination: F:\install.wim
    Name: Windows 7 ULTIMATE
    Description: Windows 7 Ultimate
    Compression: Maximum
    Display Name: Windows 7 Ultimate
    Display Desc.: Windows 7 Ultimate

    h) Finally click:

    • The “Create” button if you are working on Windows 7 Home Basic
    • The “Append” button if you are working on Windows 7 Home Premium/Professional/Ultimate virtual machines

    i) When capture process is complete, close GImageX and power off virtual machine
    j) You may now delete the virtual machine.
    All these 40 steps are applied separately for all four virtual machines. Remember: you configure Home Basic first, then Home Premium, Professional and finally Ultimate.6.Slipstreaming updates to Windows Boot Image

    6. Slipstreaming updates to Windows Boot Image

    Now that you have created the install.wim file, you have to slipstream updates in boot.wim. There is a small “gift” for us if we slipstream updates in boot.wim – so keep reading.

    1. On the host computer (after so many hours!) copy the boot.wim file from the virtual drive where you had mounted the modified Technet ISO. (It is located in /Sources folder). Paste it to the root of C: folder
    2. Run the commands (in the elevated command prompt you had opened hours ago):
    Mkdir C:\recmount
    Dism /Mount-Wim /WimFile:C:\boot.wim /index:1 /MountDir:C:\recmount
    3. Follow exactly the same steps described in Windows Recovery Slipstreaming. Perform all steps up to including step 8 .
    4. Now run these commands:
    Mkdir C:\recmount
    Dism /Mount-Wim /WimFile:C:\boot.wim /index:2 /MountDir:C:\recmount
    5. Follow exactly the same steps described in Windows Recovery Slipstreaming. Perform all steps up to including step 7.
    6. The reason why we’ll not yet perform step number 8 is the “gift” I told you earlier. By slipstreaming all-post sp1 updates boot.wim has now the latest Windows Setup files. We will add these updated versions to the new setup ISO we will create.
    7. Using Windows Explorer go to C:\mount\sources folder.
    8. Select all files EXCEPT the ARUNMIG.dll file and the recovery directory:

    a) Copy files to clipboard (Press Ctrl+C)
    b) Create a new folder in the root of C: drive named WIN7
    c) Inside the C:\WIN7 folder create an empty folder named sources
    d) Paste those files to this newly created source folder.
    e) Close all Windows Explorer windows.
    f) Execute step 8 described in "Slipstream updates in winRE.wim" section.
    9. Rebuild Windows Boot Image: Launch GImageX and select the Export tab. Use the settings below:

    Source: C:\boot.wim
    Image: 1
    Destination: C:\
    Compression: Maximum
    Name: (leave it blank)
    Boot option ON (check it)
    Check option ON (check it)

    a) Click the Export button. When export is complete, click Close to close the Progress dialog but don’t close gimagex. Instead specify Image number 2 and without changing any other settings, click export again.
    b) This time close both progress dialog and gimagex, as soon as progress is complete.
    c) Delete C:\boot.wim file
    d) Rename C:\ to boot.wim.

    7. Create Updated Windows 7 Installation Disk

    1. From the mounted ISO COPY all files and folders in the disk root – except for the sources folder – to the C:\WIN7 folder
    2. Open the /sources folder on the virtual drive.
    3. Select all files except for boot.wim and install.wim and copy them to clipboard.
    4. Paste these files to C:\WIN7\sources folder. If you are prompted to merge folders, select Yes for all items. If you are prompted to overwrite files, select “Don’t Copy” for all items!!
    5. Move the boot.wim from the C: root folder to the C:\WIN7\sources folder
    6. Move the install.wim from external hdd’s root folder to C:\Win7\sources folder
    7. Now the contents of the C:\WIN7 folder should look like:


    and in the sources subfolder:


    Note that now all Windows 7 setup core files – except for the upgrade/migration-related ones are updated to the latest version. The integrated hotfixes are reflected by the revision version number – it is greater than in SP1 RTM: 17514 in original SP1 media, 18015 in this updated distribution.

    1. Update Windows Setup catalogs: Follow the steps below:

    1. Launch Windows System Image Manager to rebuild the catalog files. First, launch Windows SIM from the start menu. (Click Start->All Programs->Windows AIK->Windows System Manager).
    2. Then right click at “Select a Windows image or catalog file” and click Select Windows image.

    Select an operating system image to create a catalog for it. Click OK.

    1. When a dialog appears prompting you to update the catalog files, click Yes. Accept UAC elevation.
    2. Wait until catalog file has been created.
    3. Right click on the image name – shown at the “Windows Image” left side pane and click “close Windows Image” at the context menu
    4. Repeat steps a till e until you have created updated catalogs for all 4 operating system images.
    5. Close Windows System Image Manager

    1. Finally, we have to save this updated files to an ISO. Unmount the modified Technet ISO we used to install Windows in Virtual machines. Simply, using your ISO editing tool modify that ISO: Delete all files in it. Copy all the contents of C:\WIN7 folder to this ISO. Save changes!
    2. At last, we are done! Burn the ISO to a DVD or USB Flash drive. Enjoy the updated installation of Windows you have just created!

    If you have any questions or remarks about this guide, feel free to post here.
  2. nealix

    nealix MDL Novice

    Jul 28, 2009
    Dear Harkaz:

    I found some confusion or small error in your above post and have this question;

    In section 6, called "Slipstreaming Updates to Windows Boot Image",
    in step 8 (Select all Files Except....), sub-step "f" says;

    "f) Execute step 8 described in page 6."

    That is my confusion. There are no pages on a web browser.
    There is just one long scroll of the document. So what is
    "execute step 8 described on page 6"?

    Sincere Thanks,

  3. nobodyin

    nobodyin MDL Novice

    Aug 21, 2011
  4. harkaz

    harkaz MDL Novice

    Dec 27, 2012
    #4 harkaz, Aug 24, 2013
    Last edited: Aug 24, 2013
    You're absolutely right. I had originally prepared a doc version of this tutorial and I just copied-pasted it here. :eek: I corrected the part you mention. Thanks for pointing it out.
    You could automate the process even more by handling the dism and sysprep commands you run after each reboot in Audit mode. This is not easy however. By the way, I use this tutorial (with some improvements) to build W7USP2. Search google for more details ;)
  5. elanmorales

    elanmorales MDL Novice

    Jan 11, 2014
    Thanks a bunch

    Im no programmer but i followed the directions at first with activated version witch failed for obvious reasons then retail. It worked like a charm. Used windows offline updates and reduced reload to 3 hrs. Wow THANKS MORE THAN I CAN AFFORD.