Offline image update of files outside of the install.wim


  1. Posts : 4,187
    Windows 11 Pro, 22H2
       #1

    Offline image update of files outside of the install.wim


    When I inject Windows updates into an offline image, that updates the install.wim file, right? in a Windows distribution, there a lot of files besides the WIM. Surely, updates must sometimes be made to those files. Just out of curiosity, how would those updates be distributed by Microsoft?

    I'm only asking out of pure curiosity.
      My Computers


  2. Posts : 17,661
    Windows 10 Pro
       #2

    hsehestedt said:
    When I inject Windows updates into an offline image, that updates the install.wim file, right?
    That is a common misconception. You do not update WIM file per se; instead, you update an offline full Windows image, then commit these changes to a WIM file.

    Adding updates to an offline image will update files in Windows, Windows\System32, Program Files, ProgramData, Users\Default\AppData folders, and in any other system folder containing a file which has an update for it available in update file you are adding to image.

    To inject updates or drivers to an offline image, you need to mount the image first. When mounted, the Mount folder contains a full offline Windows, with all system files and folders extracted. Here Windows 10 Insider Preview build 18912 (index 1, Pro edition) mounted for offline servicing:

    Offline image update of files outside of the install.wim-image.png

    You inject the updates and / or drivers to this offline Windows. When done, you will them commit (save) the changes, which in its turn updates the WIM file.

    Kari
      My Computer


  3. Posts : 4,187
    Windows 11 Pro, 22H2
    Thread Starter
       #3

    Forgive me if I'm being a little obtuse, but as I think about this, I think I'm still missing something....

    What I'm wondering about is all the files outside of that directory structure. For example, at the base of the ISO image are a number of folders such as boot, efi, support, and all the other files and folders within the sources folder aside from the contents of the WIM file. I was wondering how updating of those files is accomplished. I should have made it clearer in my original question that these are the files / folders that I was curious about.
      My Computers


  4. Posts : 6,300
    Windows 11 Pro - Windows 7 HP - Lubuntu
       #4

    Kari, please correct if I'm wrong.
    Basically:
    To mount a image you use Dism
    DISM /Mount-Wim /WimFile:"\Wim_Files\install.wim" /Index:Z /MountDir:MountDir

    To slipstream the updates
    DISM /Image:MountDir /Add-Package /Packagepath:Updates\ /IgnoreCheck

    Integrate drivers
    DISM /Image:MountDir /Add-Driver /Driverrivers\ /Recurse /ForceUnsigned

    To unmount
    DISM /Unmount-Wim /MountDir:MountDir /Commit

    Wim_Files = folder with install.wim
    MountDir = folder where you want to mount the image
    Index:Z = Z is the index number you want to mount
    Updates= folder with the updates
    Drivers = folder with the drivers
      My Computers


  5. Posts : 17,661
    Windows 10 Pro
       #5

    Megahertz said:
    Kari, please correct if I'm wrong.
    That's about right.

    I've written a tutorial about adding drivers to offline image using DISM: DISM - Add or Remove Drivers on an Offline Image

    Another tutorial shows how to inject updates to USB install media using PowerShell: PowerShell Scripting - Update Windows 10 USB install media

    Kari
      My Computer


  6. Posts : 4,187
    Windows 11 Pro, 22H2
    Thread Starter
       #6

    Pardon my jumping in. Here are the steps that I use which are working 100% flawlessly for me:


    Adding Windows updates:

    Open elevated PowerShell or command prompt. Enter following command to check what editions are included in image:

    Code:
    Dism /Get-WimInfo /WimFile:D:\ISO_Files\Sources\install.wim
    Note the index number of your selected edition. In this example we are using an index number of 6 which in this example is for Windows 10 Pro.

    Mount the image of your preferred Windows 10 edition using its index number, index 6 in this example:

    Code:
    dism /mount-image /imagefile:D:\ISO_Files\sources\install.wim /index:6 /mountdir:D:\Mount
    Get the Windows update package(s) from the Microsoft Update Catalog. For example, grab the latest cumulative update listed for Windows 10. Place the .msu file update to a folder, for example, C:\WindowsUpdates\windows10.0-kb4016871-x64_27dfce9dbd92670711822de2f5f5ce0151551b7d.msu.

    Tip: You can rename the file to something shorter to make it easier to work with. For example, KB4016871.msu.

    Add the updates to the image. For packages with dependencies, make sure you install the packages in order. If you’re not sure of the dependencies, it’s OK to put them all in the same folder, and then add them all using the same DISM /Add-Package command by adding multiple /PackagePath items.

    Example: adding a cumulative update to a mounted image:

    Code:
    Dism /Add-Package /Image:"D:\Mount" /PackagePath="D:\WindowsUpdates\windows10.0-kb4016871-x64_27dfce9dbd92670711822de2f5f5ce0151551b7d.msu"  /LogPath=D:\Mount\dism.log
    Example: adding multiple updates:

    Code:
    Dism /Add-Package /Image:"D:\Mount" /PackagePath="D:\WindowsUpdates\kb00001.msu" /PackagePath="D:\WindowsUpdates\kb00002.msu" /PackagePath="D:\WindowsUpdates\kb00003.msu" /LogPath=D:\Mount\dism.log
    Lock in the updates, so that they are restored during a recovery.

    Code:
    DISM /Cleanup-Image /Image:"D:\Mount" /StartComponentCleanup /ResetBase /ScratchDir:D:\Temp
    Verify that the packages appear correctly:

    Code:
    Dism /Get-Packages /image:”D:\Mount”
    Review the resulting list of packages and verify that the list contains the package. For example:

    Code:
    Package Identity : Package_for_RollupFix~31bf3856ad364e35~amd64~~15063.250.1.1
    State : Installed
    Release Type : Security Update
    Install Time : 04/29/2017 6:26 PM
    
    The operation completed successfully.
    Note

    Each package will usually be a new KB, and will increase the build revision number of Windows on the device. The revision number of windows a device can be found in the following registry key:

    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UBR
    If you're done updating your image, you can unmount it, committing changes.

    Code:
    Dism /Unmount-Image /MountDir:"D:\Mount” /Commit




    -----------------

    ******************************************
    * Adding Individually Downloaded Drivers *
    ******************************************

    If you downloaded individual drivers, you can add them now to offline mounted image with following command:

    For signed drivers, use this command:

    Code:
    dism /Image:D:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf
    For unsigned drivers, use this command:

    Code:
    dism /Image:D:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf /ForceUnsigned
    Replace mount folder path D:\Mount in above sample command with actual path to your mount folder, and driver path and name X:\Drivers\DriverName.inf with actual path to downloaded driver


    *************************************************
    * Adding Multiple Drivers by Recursing a Folder *
    *************************************************

    If you have folder that contains multiple drivers in subfolders, like for when exported from an existing installation, you can add all drivers with one simple command, replacing mount folder and drivers folder paths with your actual paths:

    Code:
    dism /Image:D:\Mount /Add-Driver /Driver:D:\Drivers /Recurse
    /Recurse switch will tell PowerShell to go through the main folder and its subfolders, adding all drivers it finds.


    ********************
    * Removing Drivers *
    ********************

    If you want to remove a driver from offline image, use the following command:

    Code:
    dism /Image:D:\Mount /Remove-Driver /Driver:X:\Drivers\DriverName.inf
    With /Add-Driver and /Remove-Driver you can add or remove multiple drivers:

    Code:
    dism /Image:D:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf /Driver:X:\Drivers\Driver2Name.inf
      My Computers


  7. Posts : 6,300
    Windows 11 Pro - Windows 7 HP - Lubuntu
       #7

    Kari, you with your wonderful tutorials. I still use your tutorial to move /Users to another disk / partition on win 7 and win 10.

    I built my own tutorial, back in 2016, to slipstream new drivers to the win 7 installation disk needed to install win 7 on my Z170 MB.

    As a new version of Win 10 is released every 6 months and has all drivers needed to install on new MB I don't see any reason to slipstream drivers or updates to the installation disk.
      My Computers


  8. Posts : 17,661
    Windows 10 Pro
       #8

    hsehestedt said:
    Forgive me if I'm being a little obtuse, but as I think about this, I think I'm still missing something....

    What I'm wondering about is all the files outside of that directory structure. For example, at the base of the ISO image are a number of folders such as boot, efi, support, and all the other files and folders within the sources folder aside from the contents of the WIM file. I was wondering how updating of those files is accomplished. I should have made it clearer in my original question that these are the files / folders that I was curious about.
    Boot, EFI, and Support folders and their content are only needed when booting from install media to perform a clean install. The same with the files in Sources folder.

    These files are all version specific, and have absolutely no need to be updated. In fact, Microsoft does not even offer updates for those files. The WIM file contains everything required to install Windows, and all updates for any Windows version are only for its contents.

    This is very clear when you think that WIM file is the one single and only file required to deploy Windows. For instance, following instructions in this tutorial, you will only need the install.wim, not the other files and folders on install media: Apply Windows Image using DISM Instead of Clean Install

    The same for instance if using Microsoft Deployment Toolkit to deploy Windows; you can just import the install.wim to MDT and deploy Windows from it to all target devices. See this tutorial, Part Three and especially step 3.4: Microsoft Deployment Toolkit - Easy and Fast Windows Deployment

    Long story, short version: Only files and folders in WIM image can be updated. Everything else on install media is version specific, not possible to update simply because there exists no updates for those files and folders.

    Kari
      My Computer


  9. Posts : 4,187
    Windows 11 Pro, 22H2
    Thread Starter
       #9

    Thanks, Kari. Excellent explanation, as always.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:19.
Find Us




Windows 10 Forums