Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Integrating Windows Updates into Windows 10 Install Image

February 12, 2019 Windows 10Windows Server 2012 R2

Integrating Windows Updates into Windows 10 Install Image

In this guide I’ll show how to integrate new Windows update packages into the offline installation image of Windows 10 or Windows 8.1 using built-in tools. The same way you can slipstream the latest security patches into the Windows Server 2012 R2 / 2016 install ISO images.

In this example, I will show the process of adding the latest cumulative security updates (December 2018) to the installation image of Windows 10 1803. So, we will need:

  • Windows 10 ISO installation image in format or its install.wim file;
  • Updates in the .MSU format that need to be downloaded from the Microsoft Update Catalog (How to manually download msu update files).
It’s important to make sure that your Windows OS image and the updates have the same bitness and version, otherwise, an error “Update is not applicable to your computer” will appear when installing the update.

Create the following directory structure on your computer:

  • C:\updates\mnt is the folder in which the file install.wim with the Windows installation image will be mounted;
  • C:\updates\msu is a folder in which you need to place the MSU updates for your Windows version (in this example, I downloaded 2 security updates for Windows 10 1803, released in December 2018 – KB4471331 and KB4471324);
    msu security updates for windows 10
  • C:\updates\Win10Image\ in this folder you need to copy the install.wim file from your Windows 10 install image. In our example, we mounted and unpacked the contents of the original Windows 10 ISO image Windows10x64-1803.iso. However, it can be a wim file from a virtual machine, VM template, WDS image or image stored in another OS automatic deployment software (for example, SCCM), etc.
    If your Windows 10 ISO image contains only the file c:\sources\install.esd, you can convert the ESD file to WIM file using the DISM utility: dism /export-image /SourceImageFile:"C:\updates\Win10Image\install.esd" /SourceIndex:4 /DestinationImageFile:C:\updates\Win10Image\win10pro.wim /Compress:max /CheckIntegrity
    dism /export-image convert install.esd to wim

Mount the Windows 10 installation image (install.wim) to the C:\updates\mnt folder by running the following command in the command prompt as an administrator:

dism /mount-wim /wimfile:C:\updates\Win10Image\install.wim /index:1 /mountdir:C:\updates\mnt

Tip. If your WIM image contains several versions of Windows at once, in this command you need to specify the index of the required OS version, or integrate updates for every image in turn. You can get the list of Windows editions contained in the WIM file using the command:

DISM /Get-WimInfo /WimFile:C:\updates\Win10\install.wim

install.wim with windows 10 pro image

In our example, the image contains only one OS edition – the Windows 10 Pro with the index 1, therefore in the command we need to specify install.wim /index:1.

Now you can run the integration of suitable MSU updates located in the specified directory into the Windows 10 image:

dism /image:C:\updates\mnt /add-package /packagepath:C:\updates\msu

If the system detects a wrong update (a one that is not suitable for this OS version and bitness, or if the update is already installed), it will be ignored and the corresponding information will be written to C:\Windows\Logs\DISM\dism.log.

dism msu add-package into windows 10 ofline image

To reduce the size of an image by deleting old update files (see the article about the WinSxS folder cleanup), run the command:

dism /image:C:\updates\mnt /Cleanup-Image /StartComponentCleanup /ResetBase /ScratchDir:C:\Temp

If you already have a computer with a similar version of Windows 10 that already has the latest security updates installed, you can get all the necessary update files directly from it. In this case, you don’t need to manually download MSU update files from the Microsoft Update Catalog. The trick is that Windows saves CAB files of the updates that have been downloaded from Windows Update servers or a WSUS server to the C:\Windows\SoftwareDistribution\Download folder.

C:\Windows\SoftwareDistribution\Download folder with downloaded update CAB files

Using the following command, you will start the integration of update files into the install.wim image that have already been downloaded and installed on another computer via the local network:

Start /w for /R \\Win10x64AlreadyPatchedPC\C$\Windows\SoftwareDistribution\Download\ %f in (*.cab) do dism /image:C:\updates\mnt /add-package /packagepath:”%f”

In this example, Win10x64AlreadPatchedPC is the name of the remote computer on which the necessary updates are already installed (the OS version and bitness must match). Of course, this computer should be accessible over the network, and your account should be added to the local administrators group on it. In the window that opens, you can watch the process of installing updates to the offline Windows image. DISM will try to add to your WIM image each CAB file file that was found on a remote computer.

If you encounter an error while integrating updates into a Windows image: “Error 0xc0000135 An error occurred while attempting to start the servicing process for the image located at C:\Update\mount. For more information, review the log file”, make sure you are using the latest version of DISM. For example, you are trying to modify a Windows Server 2016 image from Windows 8.1. Install the latest available version Windows Assessment and Deployment Kit (Windows ADK) for your OS and run DISM directly from the catalog C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM.

And the last step is to save the changes and unmount the Windows 10 image:

dism /unmount-wim /mountdir:C:\updates\mnt /commit
dism /Cleanup-Wim

unmount wim image with commit changes

You only have to copy install.wim to the source directory/virtual machine or rebuild the installation ISO image, e. g., using oscdimg,UltraISO or Dism++.

If the size of your install.wim file is more than 4 GB you may encounter the error “Windows cannot open the required file D:\sources\install.wim. Error code: 0x8007000D” during Windows installation on the UEFI system. In this case, you need to split the source install.wim into smaller files with the command:

dism /split-Image /imagefile:C:\Update\Win10Image\install.wim /swmfile:C:\Update\Win10Image\install.swm /filesize:4096

(see the articles How to create a UEFI bootable Windows 7 installation USB drive and Create Bootable Windows Server 2016 USB Installation Drive).

After that, the original install.wim can be removed.

DISM also allows you to add drivers to an offline image. Previously, we considered how to integrate drivers into a Windows installation image using DISM or cmdlet Add-WindowsDriver on the example of Windows 10 / 8.1 / Windows Server 2012 R2 / 2016 or Windows 7 (Adding USB3 drivers to your Windows 7 installation).

Now you can deploy your Windows install image with the latest security updates integrated on computers in your network. By regularly integrating the latest security updates into your Windows image deployed on new computers, you increase the security of your infrastructure against the latest vulnerabilities and reduce the risk of infecting new computers until they start updating from WSUS.

3 comments
0
Facebook Twitter Google + Pinterest
previous post
Copying Large Files over an Unreliable Network Using BITS and PowerShell
next post
ESXi: Slow Disk Performance on HPE Gen8

Related Reading

Configure User’s Folder Redirection with Group Policy

February 3, 2023

Disable Built-in PDF Viewer in Microsoft Edge

February 3, 2023

Join a Windows Computer to an Active Directory...

February 2, 2023

Using Previous Command History in PowerShell Console

January 31, 2023

How to Install the PowerShell Active Directory Module...

January 31, 2023

3 comments

DG June 23, 2020 - 10:39 pm

Great post. A few inconsistencies in the file paths. Some commands use C:\updates and others user C:\update

Also: Win10Image vs Win10

Reply
Smurfy July 31, 2020 - 3:23 pm

Super guide many thanks!

Reply
jraju August 14, 2020 - 3:45 pm

where are updates files are stored in the integration process.
can we post check if the iso contains the updates and service packs.
can we view them

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Configure User’s Folder Redirection with Group Policy

    February 3, 2023
  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Booting Windows 7 / 10 from GPT Disk on BIOS (non-UEFI) systems
  • Error Code: 0x80070035 “The Network Path was not found” after Windows 10 Update
  • Removable USB Flash Drive as Local HDD in Windows 10 / 7
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
  • How to increase KMS current count (count is insufficient)
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
  • Configuring L2TP/IPSec VPN Connection Behind a NAT, VPN Error Code 809
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top