Valid HTML 4.01 Transitional Valid CSS Valid SVG 1.0

Me, myself & IT

Installation of Microsoft® Windows® 7 SP1 with slipstreamed update packages

Purpose

Automatic (unattended) or manual offline installation of (security) update packages for Microsoft Windows 7 SP1,
either during Windows Setup from an unmodified original DVD,
or before the (initial) installation from a modified installation media.

Note: when the installation is started from (bootable) USB storage media, SD card etc., update packages can of course be installed during Windows Setup too.
Caveat: due to both a bug and a limitation the convenience rollup update package 3125574 can't be installed during Windows Setup!

Reason

Prerequisites

Installation of update packages during Windows Setup

You choose to perform an offline installation of update packages into the applied image created by Windows Setup.

Preparation

On a computer running Windows 95 OSR2 Vista SP2 or a newer version of Windows NT, perform the following 16 steps:
  1. Download at least the last cumulative (security) update package for Internet Explorer 8, 3124275 alias MS16-001, and the latest (security) update package for the Windows Update Client, currently (February 28, 2017) 3161647; the latter is available only as part of the July 2016 (optional) update rollup package 3172605.

    Note: be sure to download the update packages that match the processor architecture (32-bit: x86 alias I386; 64-bit: x64 alias AMD64) of your installation disc (or media)!

    Optionally download other update packages of your choice, for example 917607, 958559, 2670838, 2685811, 2685813, 2729094, 2834140, 2836502, 2952664, 2999226, 3150513, 3177467, 3179573, 3185278, 3185330, 3197868, 3203884 and 3207752, and process them in the following steps like 3124275 and 3172605 too.

    Note: don't forget to kick Microsoft for their bit-rotten MSKB article 949104!

  2. Open the directory where you saved the downloaded update packages in Windows Explorer.
    This is typically the Downloads directory in your user profile, %USERPROFILE%\Downloads\.

    In this directory you should see at least the files
    Windows6.1-KB3124275-x86.msu and Windows6.1-KB3172605-x86.msu (for 32-bit processor architecture) or
    Windows6.1-KB3124275-x64.msu and Windows6.1-KB3172605-x64.msu (for 64-bit processor architecture).

  3. Change the extension of the files Windows6.1-KB*-x??.msu you downloaded in step 1. from .msu to .cab.

  4. Open the renamed files (which are compressed archives) Windows6.1-KB*-x??.cab per double-click in Windows Explorer.

    In each opened window you should see the four files
    Windows6.1-KB*-x??.cab, Windows6.1-KB*-x??.xml,
    Windows6.1-KB*-x??-pkgProperties.txt and WSUSSCAN.cab.

  5. Plug an (preferable empty) USB storage media or an (preferable empty) SD card into your computer.

  6. From each compressed archive you opened in step 4., copy the files Windows6.1-KB*-x??.cab and Windows6.1-KB*-x??.xml (per drag & drop) to the root directory of the drive attached in step 5., then close its window.

  7. If you want to keep the files downloaded in step 1., undo the changes made in step 3., i.e. restore the original extension .msu on all files you renamed, else delete these files.

  8. Open the root directory of the drive you attached in step 5. in Windows Explorer.

    In this directory you should see at least the four files
    Windows6.1-KB3124275-x??.cab and Windows6.1-KB3124275-x??.xml plus
    Windows6.1-KB3172605-x??.cab and Windows6.1-KB3172605-x??.xml.

  9. Change the extension of the files Windows6.1-KB*-x??.xml you extracted in step 6. from .xml to .txt.

  10. In the right pane of the root directory window open the context menu per right-click and select New, then choose Text document and change the filename from New text document to AutoUnattend.

  11. Open the empty file AutoUnattend.txt per double-click in Editor.

  12. Open each (not yet empty) file Windows6.1-KB*-x??.txt you renamed in step 9. per double-click in Editor, select its contents per [Ctrl][A], cut the selection per [Ctrl][X], close the file and save the changes (thereby writing the empty file back), then insert the cut contents per [Ctrl][V] at the bottom of the AutoUnattend.txt file.

  13. In the (still open) AutoUnattend.txt file delete each block of the six consecutive lines

        </servicing>
    </unattend>
    
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <servicing>
    then close the file and save the changes.
  14. Change the extension of the AutoUnattend.txt file from .txt to .xml.

  15. Delete the (now empty) files Windows6.1-KB*-x??.txt you renamed in step 9. and rewrote in step 12.

  16. Use Safely Remove Hardware from the notification area alias system tray of the taskbar to eject the prepared USB storage media or SD card, then unplug it from your computer.

Operation

On the target computer, insert your original Windows 7 SP1 installation DVD and the prepared USB storage media or SD card, then boot from your installation disc (or media) and proceed as instructed on the screen: Windows Setup detects the AutoUnattend.xml answer file and applies it during installation.

Note: ‹target drive›:\$WINDOWS.~BT\Sources\DISM.exe, the program run by Windows Setup to perform this task, writes the log file ‹target drive›:\$WINDOWS.~BT\Sources\Panther\CBS.log, which is stored as %SystemRoot%\Panther\CBS.log in the installed system for later examination.

Caveat: for Windows Vista, the MSKB article 939289 documents a bug with the method presented here, and its resolution.
If you encounter this bug with Windows 7 SP1 too, perform the alternative (automatic or manual) installation below, or insert the following lines before the last line of the AutoUnattend.xml answer file:

    <settings pass="windowsPE">
        <component
            language="neutral"
            name="Microsoft-Windows-Setup"
            processorArchitecture="*"
            publicKeyToken="31bf3856ad364e35"
            versionScope="nonSxS">
            <userData>
                <acceptEula>true</acceptEula>
            </userData>
        </component>
    </settings>

Alternative (automatic) installation

Boot from your installation disc (or media) and select your language, then press [Shift][F10] to start a Command Prompt instead clicking the Install now button.
From the Command Prompt run the following command line, referencing the AutoUnattend.xml answer file created above:
Setup.exe /Unattend:"[‹path›\]AutoUnattend.xml"

Alternative (manual) installation

Boot from your installation disc (or media) and select your language, then press [Shift][F10] to start a Command Prompt instead clicking the Install now button.
From the Command Prompt run the following command line first:
Setup.exe /NoReboot
After completion run
DISM.exe /Image:"‹target drive›:" /LogPath:"‹target drive›:\Windows\Logs\DISM\DISM.log" /ScratchDir:"‹target drive›:\Windows\Temp" /Apply-Unattend:"[‹path›\]AutoUnattend.xml"
to use the AutoUnattend.xml answer file created above, or run
DISM.exe /Image:"‹target drive›:" /LogPath:"‹target drive›:\Windows\Logs\DISM\DISM.log" /ScratchDir:"‹target drive›:\Windows\Temp" /Add-Package /PackagePath:"[‹path›\]Windows6.1-KB…-x….cab" […]
to install one or more update packages without answer file.

Installation of update packages before Windows Setup

You choose to perform an offline installation of update packages into the mounted image of the installation disc's \sources\install.wim.

Preparation

On a computer running Windows 7 SP1 perform the following 17 steps:
  1. Download the following update packages:

    • 2670838, a prerequisite for Internet Explorer 11;
    • 2685811, the latest KMDF;
    • 2685813, the latest UMDF;
    • 2729094, a prerequisite for Internet Explorer 11;
    • 2841134, Internet Explorer 11;
    • 2841134, the (94) language pack(s) for Internet Explorer 11;
    • 2849696, the (36) localized spelling pack(s) for Internet Explorer 11;
    • 2849697, the (17) localized hyphenation pack(s) for Internet Explorer 11;
    • 3020369, the prerequisite for the convenience rollup update package;
    • 3124275 alias MS16-001, the last cumulative (security) update package for Internet Explorer 8;
    • 3125574, the convenience rollup update package;
    • 3172605, the July 2016 (optional) update rollup package, containing the latest (security) update package for the Windows Update Client;
    • 3179573, the August 2016 (optional) update rollup package.

    Note: be sure to download the update packages that match the processor architecture (32-bit: x86 alias I386; 64-bit: x64 alias AMD64) and the language of your installation disc!

    A batch script BITS_ALL.CMD which downloads these update packages using BITS is available upon request.

    Caveat: due to a bug the newer update package 3177467 which replaces 3020369 is not suitable as prerequisite for offline installation of the convenience rollup update package!

  2. Open the directory where you saved the downloaded update packages in Windows Explorer.
    This is typically the Downloads directory in your user profile, %USERPROFILE%\Downloads\.

    For slipstreaming a german 32-bit edition of Windows 7 SP1 you should see the following files there:

    IE-Hyphenation-de.msu
    IE-Spelling-de.msu
    IE11-Windows6.1-KB2841134-x86.cab
    kmdf-1.11-Win-6.1-x86.msu
    Umdf-1.11-Win-6.1-x86.msu
    Windows6.1-KB2670838-x86.msu
    Windows6.1-KB2729094-v2-x86.msu
    Windows6.1-KB2841134-x86.cab
    Windows6.1-KB3020369-x86.msu
    Windows6.1-KB3124275-x86.msu
    windows6.1-kb3125574-v4-x86_ba1ff5537312561795cc04db0b02fbb0a74b2cbd.msu
    Windows6.1-KB3172605-x86.msu
    Windows6.1-KB3179573-x86.msu

    For slipstreaming a german 64-bit edition of Windows 7 SP1 you should see the following files there:

    IE-Hyphenation-de.msu
    IE-Spelling-de.msu
    IE11-Windows6.1-KB2841134-x64.cab
    kmdf-1.11-Win-6.1-x64.msu
    Umdf-1.11-Win-6.1-x64.msu
    Windows6.1-KB2670838-x64.msu
    Windows6.1-KB2729094-v2-x64.msu
    Windows6.1-KB2841134-x64.cab
    Windows6.1-KB3020369-x64.msu
    Windows6.1-KB3124275-x64.msu
    windows6.1-kb3125574-v4-x64_2dafb1d203c8964239af3048b5dd4b1264cd93b9.msu
    Windows6.1-KB3172605-x64.msu
    Windows6.1-KB3179573-x64.msu

    Note: the update packages IE11-Windows6.1-KB2841134-x??.cab and Windows6.1-KB*-??.msu are language-neutral!

    Note: there is no english (en-US) language pack Windows6.1-KB2841134-x??.cab for Internet Explorer 11!

    Note: the hyphenation and spelling pack files IE-Hyphenation-??.msu and IE-Spelling-??.msu for Internet Explorer 11 are architecture-independent!

    Note: adaption of the filenames and download links for other languages and locales is left as (trivial) exercise to the reader.

    Note: the 40-character suffixes (like ba1ff5537312561795cc04db0b02fbb0a74b2cbd and 2dafb1d203c8964239af3048b5dd4b1264cd93b9 shown above) in the name of files available from the Microsoft Download Catalog are the SHA-1 hashes of these files.

  3. Rename the (german) language pack file Windows6.1-KB2841134-x??.cab to Windows6.1-KB2841134-x??-de-DE.cab first, then rename IE11-Windows6.1-KB2841134-x??.cab to Windows6.1-KB2841134-x??.cab.

    Note: renaming of other locale's language pack files Windows6.1-KB2841134-x??.cab to Windows6.1-KB2841134-x??-??-??.cab is left as (trivial) exercise to the reader.

  4. Create an empty directory and move the renamed files Windows6.1-KB2841134-x*.cab into it.

  5. Change the extension of the files you downloaded in step 1. from .msu to .cab.

  6. Open the renamed files (which are compressed archives) per double-click in Windows Explorer.

    In each opened window you should see the four files
    Windows6.?-KB*-x??.cab, Windows6.?-KB*-x??.xml,
    Windows6.?-KB*-x??-pkgProperties.txt and WSUSSCAN.cab.

  7. From each compressed archive you opened in step 6., copy the file Windows6.?-KB*-x??.cab (per drag & drop) to the directory you created in step 4., then close its window.

  8. If you want to keep the files downloaded in step 1., undo the changes made in step 5., i.e. restore the original extension .msu on all files you renamed, else delete these files, then close the window you opened in step 2.

  9. Open the directory you created in step 4. in Windows Explorer.

    For slipstreaming a german 32-bit edition of Windows 7 SP1 you should see the following files there:

    Windows6.1-KB2670838-x86.cab
    Windows6.1-KB2685811-x86.cab
    Windows6.1-KB2685813-x86.cab
    Windows6.1-KB2729094-v2-x86.cab
    Windows6.1-KB2841134-x86.cab
    Windows6.1-KB2841134-x86-de-DE.cab
    Windows6.1-KB3020369-x86.cab
    Windows6.1-KB3124275-x86.cab
    Windows6.1-KB3125574-v4-x86.cab
    Windows6.1-KB3172605-x86.cab
    Windows6.1-KB3179573-x86.cab
    Windows6.3-KB2849696-x86.cab
    Windows6.3-KB2849697-x86.cab

    Note: the hyphenation and spelling pack files Windows6.3-KB2849696-x86.cab and Windows6.3-KB2849697-x86.cab for Internet Explorer 11 are architecture-independent!

  10. Rename the (german) spelling pack file Windows6.3-KB2849696-x86.cab to Windows6.3-KB2849696-de.cab, and the (german) hyphenation pack file Windows6.3-KB2849697-x86.cab to Windows6.3-KB2849697-de.cab.

    Note: renaming of other language's spelling and hyphenation pack files Windows6.3-KB2849696-x86.cab and Windows6.3-KB2849697-x86.cab to Windows6.3-KB2849696-??.cab and Windows6.3-KB2849697-??.cab respectively is left as (trivial) exercise to the reader.

  11. Copy the file \sources\install.wim from your Windows 7 SP1 installation DVD into the directory opened in step 9.

    Note: you can merge the \sources\install.wim from a 32-bit and a 64-bit installation disc into one install.wim to create a single installation media for both processor architectures: 32-bit Windows PE supports the installation of 64-bit images too; see the TechNet articles Cross-Platform Deployment, Windows Setup Cross-Platform Deployment, Create a Windows Image for Multiple Architecture Types and Create a Windows Image for Multiple Architecture Types for details!

  12. Open an elevated (i.e. administrative) Command Prompt in this directory and run the following seven command lines for every Windows 7 edition you need or want to update:

    MKDIR "%SystemDrive%\WIM"
    "%SystemRoot%\System32\DISM.exe" /Mount-Wim /MountDir:"%SystemDrive%\WIM" /WimFile:"%CD%\install.wim" /Index:‹index›
    "%SystemRoot%\System32\DISM.exe" /Image:"%SystemDrive%\WIM" /Add-Package /PackagePath:"%CD%\Windows6.1-KB3020369-x86.cab"
    "%SystemRoot%\System32\DISM.exe" /Image:"%SystemDrive%\WIM" /Add-Package /PackagePath:"%CD%\Windows6.1-KB2670838-x86.cab" /PackagePath:"%CD%\Windows6.1-KB2685811-x86.cab" /PackagePath:"%CD%\Windows6.1-KB2685813-x86.cab" /PackagePath:"%CD%\Windows6.1-KB2729094-v2-x86.cab" /PackagePath:"%CD%\Windows6.1-KB3124275-x86.cab" /PackagePath:"%CD%\Windows6.1-KB3172605-x86.cab" /PackagePath:"%CD%\Windows6.1-KB3179573-x86.cab" /PackagePath:"%CD%\Windows6.1-KB3125574-v4-x86.cab"
    "%SystemRoot%\System32\DISM.exe" /Image:"%SystemDrive%\WIM" /Add-Package /PackagePath:"%CD%\Windows6.1-KB2841134-x86.cab" /PackagePath:"%CD%\Windows6.1-KB2841134-x86-de-DE.cab" /PackagePath:"%CD%\Windows6.3-KB2849696-de.cab" /PackagePath:"%CD%\Windows6.3-KB2849697-de.cab"
    "%SystemRoot%\System32\DISM.exe" /Unmount-Wim /MountDir:"%SystemDrive%\WIM" /Commit
    RMDIR "%SystemDrive%\WIM"
    Note: replace ‹index› with the index of the Windows 7 edition of your installation disc!
    EditionIndex
    32-bit64-bit
    Starter1
    Home Basic21
    Home Premium32
    Professional43
    Ultimate54

    Note: for 64-bit images change every occurrence of -x86 to -x64.

    Caveat: if one of the three command lines DISM.exe … /Add-Package … happens to fail run the following two command lines to discard all changes, unmount the image and remove the directory, then stop:

    "%SystemRoot%\System32\DISM.exe" /Unmount-Wim /MountDir:"%SystemDrive%\WIM" /Discard
    RMDIR "%SystemDrive%\WIM"
    Note: addition of more or other locale's language pack files Windows6.1-KB2841134-x86-??-??.cab and more or other language's spelling and hyphenation pack files Windows6.3-KB2849696-??.cab and Windows6.3-KB2849697-??.cab for Internet Explorer 11 is left as (trivial) exercise to the reader.
  13. Plug an (preferable empty) USB storage media or an (preferable empty) SD card into your computer.

  14. Run the following command line in the (still open) elevated Command Prompt:

    "%SystemRoot%\System32\DiskPart.exe"
  15. Enter the following statements at the DISKPART> prompt to determine the disk number of the USB storage media or SD card first, then clobber it, partition it, make it bootable, assign a drive letter and exit the DiskPart.exe utility:

    LIST DISK
    SELECT DISK ‹number›
    CLEAN
    CREATE PARTITION PRIMARY
    ACTIVE
    ASSIGN
    EXIT
    Note: replace ‹number› with the appropriate disk number from the output of the LIST DISK statement.

    Note the drive letter shown in the AutoPlay dialog box, then close it.

  16. Run the following four command lines in the (still open) elevated Command Prompt to format the USB storage media or SD card, copy the contents of the Windows 7 SP1 installation DVD, move the modified install.wim to it, and finally close the Command Prompt:

    "%SystemRoot%\System32\Format.exe" ‹drive letter›: /FS:NTFS /Q /S:Disable
    "%SystemRoot%\System32\XCopy.exe" ‹optical drive›:\* ‹drive letter›: /E /EXCLUDE:install.wim /Q
    MOVE "%CD%\install.wim" ‹drive letter›:\sources
    EXIT
    Note: replace ‹drive letter› with the drive letter shown in the AutoPlay dialog box from step 15.
  17. Use Safely Remove Hardware from the notification area alias system tray of the taskbar to eject the prepared USB storage media or SD card, then unplug it from your computer.

Operation

On the target computer, insert the prepared USB storage media or SD card, then boot from it and proceed as instructed on the screen.

Limitation

Setup.exe and DISM.exe, the programs behind Windows Setup, install all update packages referenced in the <servicing> section of the AutoUnattend.xml answer file in a single session: the update package 3020369, a prerequisite for the convenience rollup update package 3125574, but has to be installed in a separate session.

Caveat: due to a bug the newer update package 3177467 which replaces 3020369 is not suitable as prerequisite for offline installation of the convenience rollup update package!

Bug

Offline installation of the convenience rollup update package 3125574 into an applied image (like the one created by Windows Setup) residing on a disk volume alias partition using one of the equivalent command lines
"%SystemRoot%\System32\DISM.exe" /Image:"‹target drive›:" /Apply-Unattend:"[‹path›\]Windows6.1-KB3125574-v4-x86.xml"
"%SystemRoot%\System32\DISM.exe" /Image:"‹target drive›:" /Add-Package /PackagePath:"[‹path›\]Windows6.1-KB3125574-v4-x86.cab"
fails with Win32 error 5 alias ERROR_ACCESS_DENIED (derived from NTSTATUS 0xC0000121 alias STATUS_CANNOT_DELETE) returned from the attempt to create the hardlink ‹target drive›:\Windows\System32\MSI.dll and renders the applied image unusable!

Online installation using one of the equivalent command lines

"%SystemRoot%\System32\DISM.exe" /Online /Apply-Unattend:"[‹path›\]Windows6.1-KB3125574-v4-x86.xml"
"%SystemRoot%\System32\DISM.exe" /Online /Add-Package /PackagePath:"[‹path›\]Windows6.1-KB3125574-v4-x86.cab"
but works as designed and documented.

Offline installation of the convenience rollup update package 3125574 into a virtual hard disk image using the same command line

"%SystemRoot%\System32\DISM.exe" /Image:"‹target drive›:" /Apply-Unattend:"[‹path›\]Windows6.1-KB3125574-v4-x86.xml"
"%SystemRoot%\System32\DISM.exe" /Image:"‹target drive›:" /Add-Package /PackagePath:"[‹path›\]Windows6.1-KB3125574-v4-x86.cab"
as well as its offline installation into a mounted image using the command lines
"%SystemRoot%\System32\DISM.exe" /Mount-Wim /MountDir:"‹directory›" /WimFile:"[…\]Install.wim" /Index:‹index›
"%SystemRoot%\System32\DISM.exe" /Image:"‹directory›" /Apply-Unattend:"[‹path›\]Windows6.1-KB3125574-v4-x86.xml"
"%SystemRoot%\System32\DISM.exe" /Image:"‹directory›" /Add-Package /PackagePath:"[‹path›\]Windows6.1-KB3125574-v4-x86.cab"
"%SystemRoot%\System32\DISM.exe" /Unmount-Wim /MountDir:"‹directory›" /Commit
works too.

Offline installation into a mounted image or a virtual hard disk image but fails and renders the mounted image or the virtual hard disk image unusable if the convenience rollup update package is installed together with other update packages, for example 3161608 or 3172605, but not as last update package of the session!

"%SystemRoot%\System32\DISM.exe" /Mount-Wim /MountDir:"‹directory›" /WimFile:"[…\]Install.wim" /Index:‹index›
"%SystemRoot%\System32\DISM.exe" /Image:"‹directory›" /Add-Package /PackagePath:"[‹path›\]Windows6.1-KB3125574-v4-x86.cab" /PackagePath:"[‹path›\]Windows6.1-KB3172605-x86.cab"

Further actions

Unless you definitively need .NET Framework 4, .NET Framework 4.5, .NET Framework 4.6 or .NET Framework 4.7, create the Registry entries
REGEDIT4

; Copyright © 2011-2017, Stefan Kanthak <‍skanthak‍@‍nexgo‍.‍de‍>

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\WU]
"BlockNetFramework4"=dword:00000001
"BlockNetFramework45"=dword:00000001
"BlockNetFramework451"=dword:00000001
"BlockNetFramework452"=dword:00000001
"BlockNetFramework46"=dword:00000001
"BlockNetFramework461"=dword:00000001
"BlockNetFramework462"=dword:00000001
"BlockNetFramework47"=dword:00000001
to block their automatic installation via Windows Update, as documented in the MSKB articles 982320, 2721187, 2971109, 3133990 and 4024204.

Note: use the batch script SetupComplete.cmd to apply these Registry entries automatically after Windows Setup.

Contact

If you miss anything here, have additions, comments, corrections, criticism or questions, want to give feedback, hints or tipps, report broken links, bugs, errors, inaccuracies, omissions, vulnerabilities or weaknesses, …:
don't hesitate to contact me and feel free to ask, comment, criticise, flame, notify or report!

Use the X.509 certificate to send S/MIME encrypted mail.

Notes: I dislike HTML (and even weirder formats too) in email, I prefer to receive plain text.
I also expect to see a full (real) name as sender, not a nickname!
Emails in weird formats and without a proper sender name are likely to be discarded.
I abhor top posts and expect inline quotes in replies.

Terms and conditions

By using this site, you signify your agreement to these terms and conditions. If you do not agree to these terms and conditions, do not use this site!
Copyright © 1995-2017 • Stefan Kanthak • <‍skanthak‍@‍nexgo‍.‍de‍>