Update drivers and packages: Intro to offline servicing

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

In this section of the OEM Windows Deployment and Imaging Walkthrough, you use offline servicing to add drivers (such as updates to hardware drivers) and packages (such as Windows updates) to a Windows image file. You can also upgrade the edition of Windows as needed. This is often the fastest way to update images, and to create new images when you introduce new designs.

Prepare the images for offline servicing

Copy the thin image file

  1. On the technician PC, connect the external USB hard drive.

  2. Click Start, and type deployment. Right-click Deployment and Imaging Tools Environment and then select Run as administrator.

  3. Copy the thin image from the external USB hard drive to the technician PC, using a new file name: ModelSpecificImage.wim. This file represents a new PC design, and is based on the image that you captured in Prepare a snapshot of the PC: Generalize and capture Windows images.

    md C:\images\
    
    copy E:\Images\ThinImage.wim C:\images\ModelSpecificImage.wim
    

    where E: is the drive letter of the external USB hard drive.

    This can take several minutes.

Mount the Windows image file

  • Mount the Windows image. The mounting process maps the contents of an image file to a location where you can view and modify the mounted image.

    md C:\mount\windows
    
    Dism /Mount-Image /ImageFile:"C:\Images\ModelSpecificImage.wim" /Name:"Fabrikam" /MountDir:"C:\mount\windows" /Optimize
    

    Where C is the drive letter of the drive that contains the image and Fabrikam is the name of the image.

    This step can take several minutes.

Note

  • To service an image of Windows 8.1, you must use the version of DISM for Windows 8.1. For more information, see How to copy DISM to another computer.

  • The Dism /Mount-Image: /Optimize option allows you to begin working on the image files immediately. When you use the /Optimize option, the individual subfolders are added only as DISM needs them. When /Optimize is used, individual commands can take more time than usual.

  • Troubleshooting: If the DISM commands in this section fail, try the following steps:
    • If this command fails, make sure that you are using the Windows 8.1 version of DISM that is installed with the Windows ADK.

      If you are using a Windows 8 or Windows 7 PC, use the Deployment and Imaging Tools Environment to access the tools that are installed together with the Windows 8.1 version of the Windows ADK.

    • Don’t mount images to protected folders, such as your User\Documents folder.

    • If DISM processes are interrupted, consider temporarily disconnecting from the public network and disabling virus protection.

    • If DISM processes are interrupted, consider running the commands from the Windows PE environment.

    Mount the Windows RE image file

    • Mount the Windows RE image file. The Windows RE image file is part of the Windows image.

      md C:\mount\winre
      
      Dism /Mount-Image /ImageFile:"C:\mount\windows\Windows\System32\Recovery\winre.wim" /index:1 /MountDir:"C:\mount\winre"
      

      Where C is the drive letter of the drive that contains the image.

      This step can take several minutes.

    Note

    We recommend that you update the Windows and Windows RE images at the same time, to help make sure that any necessary files are included in both images.

    Modify the images

    Add driver packages (.inf files)

    1. Add driver packages. Driver packages typically include a folder that contains multiple files. These files include a file that has the .inf extension. This file manages the other files in the driver package. Many boot-critical driver packages can be used in both the Windows image and the Windows RE image:

      Dism /Add-Driver /Image:"C:\mount\windows" /Driver:"C:\SampleDriver\driver.inf"
      
      Dism /Add-Driver /Image:"C:\mount\winre" /Driver:"C:\SampleDriver\driver.inf"
      

      where C is the drive letter of the drive that contains the image and "C:\SampleDriver\driver.inf" is the path to a driver package that is specific to the PC model.

    Note

    Although you can add multiple drivers to an image by using one command, it is often easier to troubleshoot problems by adding each driver package individually.

    1. Verify that the driver packages are part of the images:

      Dism /Get-Drivers /Image:"C:\mount\windows" 
      
      Dism /Get-Drivers /Image:"C:\mount\winre" 
      

      where C is the drive letter of the drive that contains the image.

      Review the resulting list of drivers and verify that the list contains the driver package that you added. For example:

      Published Name : oem0.inf
      Original File Name : prnms001.inf
      Inbox : No
      Class Name : Printer
      Provider Name : Microsoft
      Date : 6/21/2006
      Version : 6.3.9600.16384
      

    Add packages and optional components (.cab files)

    1. Add packages to the Windows image. Service packs and language packs are typically compressed files that have a .cab file name extension.

      Dism /Add-Package /Image:"C:\mount\windows" /PackagePath:"C:\SamplePackage\package.cab"
      

      where C is the drive letter of the drive that contains the image and "C:\SamplePackage\package.cab" is the path to a Windows package.

    Note

    Although you can add multiple packages to an image by using one command, troubleshooting is often easier if you add each package individually.

    1. Verify that the package is part of the image:

      Dism /Get-Packages /Image:"C:\mount\windows"
      

      where C is the drive letter of the drive that contains the image.

      Review the resulting list of packages and verify that the list contains the package. For example:

      Package Identity : Microsoft-Windows-CameraCodec-Package~31bf3856ad364e35~amd64~
      ~6.3.9600.16453
      State : Installed
      Release Type : Update
      Install Time : 1/2/2014 6:45 PM
      

    Upgrade the Windows edition

    1. Find the editions of Windows that you can change your image to.

      Dism /Image:C:\test\offline /Get-TargetEditions
      

      Note the edition-ID for the edition you want to change to.

    2. Specify the edition-ID to change the Windows image to a higher edition, for example, Windows 8.1 Enterprise. For more info, see Windows 8 and Windows 8.1 Upgrade Paths.

      Dism /Image:C:\test\offline /Set-Edition:Enterprise
      

    Unmount the images

    Instructions

    1. Close all applications that might access files from the image, such as Windows SIM.

    2. Commit the changes and unmount the Windows RE image:

      Dism /Unmount-Image /MountDir:"C:\mount\winre" /Commit
      

      where C is the drive letter of the drive that contains the image.

      This process can take a few minutes.

    3. Make a backup copy of the updated Windows RE image:

      xcopy C:\mount\windows\Windows\System32\Recovery\winre.wim E:\Images\WinRE-ModelSpecific-Backup.wim /ah
      

      where C is the drive letter of the drive that contains the image and E is the drive letter of the backup device or volume.

    4. Check the new size of the Windows RE image.

      Dir "C:\mount\windows\Windows\System32\Recovery\winre.wim"
      

      If the size of the partition is greater than 250MB, modify the deployment script: CreatePartitions-<Firmware>.txt with the new value, adding 50MB to the final size. For more info, see Configure UEFI/GPT-Based Hard Drive Partitions.

      rem == 1. Windows RE tools partition ===============
      create partition primary size=330
      
    5. Commit the changes and unmount the Windows image:

      Dism /Unmount-Image /MountDir:"C:\mount\windows" /Commit
      

      where C is the drive letter of the drive that contains the image.

      This process may take several minutes.

    6. Copy the model-specific image to the external USB hard drive:

      copy C:\Images\ModelSpecificImage.wim E:\Images\
      

      where C is the drive letter of the drive that contains the image and E is the drive letter of the external USB hard drive.

    Verify customizations for drivers and packages

    Deploy the image to a test PC

    1. Use the same procedure and script that you used in Apply Windows images to boot a test PC to Windows PE and deploy the new image:

      diskpart /s E:\Deployment\CreatePartitions-<Firmware>.txt
      
      E:\Deployment\ApplyImage-<Firmware> E:\Images\ModelSpecificImage.wim
      

      where E is the drive letter of the external USB hard drive.

    2. After installation completes, type exit to restart the PC.

    Verify drivers and packages

    1. Complete OOBE, and click Desktop.

    2. Click Start, type Command Prompt. Right-click Command Prompt, and then select Run as administrator.

    3. Verify that the drivers appear correctly:

      C:\Windows\System32\Dism /Get-Drivers /Online
      
    4. Verify that the packages appear correctly:

      C:\Windows\System32\Dism /Get-Packages /Online
      

    Compare your image

    See how your new drivers, packages, and apps affect system performance by using Windows Assessment Tools. For more info, see the Windows Assessment Console Step-by-Step Guide.

    See Also

    Concepts

    OEM Windows Deployment and Imaging Walkthrough