Jaa


Deploy a Custom Image

In this topic you create a reference installation, capture an image of the installation, and rerun Windows Setup with an answer file that points to your custom image. Deploying a custom image using Windows Setup provides several benefits over applying an image using an image capture tool.

Setup supports the following:

  • Applying another answer file for additional customizations during deployment.
  • Reconfiguring disk configuration.
  • Adding additional drivers.
  • Replacing a product key.
  • Selecting a different language to install.
  • Selecting from a list of images to install, if your image file contains more than one image.
  • Installing to a different drive location.
  • Upgrading an existing Windows installation.
  • Configuring the computer to dual-boot operating systems.
  • Ensuring that the hardware can support Windows.

Installing a custom image using Windows Setup has some limitations. For more information, see Windows Setup Scenarios and Best Practices.

Prerequisites

To complete this walkthrough, you need the following:

  • A technician computer that has the Windows Assessment and Deployment Kit (Windows ADK) tools installed.
  • A Windows product ISO.
  • A reference computer on which you will install and capture your custom image.
  • Bootable Windows PE media. There are several types of Windows PE media that you can create. For more information about these options, see WinPE overview.
  • Access to a network share to store your custom image and Windows Setup source files.

Step 1: Copy the Windows installation source files to a network share

On your technician computer, copy the entire contents of the Windows installation media to a network share.

For example:

net use N: \\server\share\
xcopy D: N:\WindowsDVD\ /s

where D: is the Windows installation media. Windows installation media could be a mounted Windows installation ISO, or a USB installation drive.

Step 2: Install Windows onto your reference computer

  1. Create a reference installation by using one of the following methods:

  2. After the installation is complete, shut down the computer.

Step 3: Capture an image of the installation

In this step, you'll capture an image of the reference installation by using DISM and then store the custom image on a network share.

  1. Boot the reference computer using your bootable Windows PE media.

  2. At the WinPE command prompt, use DISM to capture an image of the installation. Specify a name and description as part of your image capture. All values are required by Windows Setup. If a .wim file does not include these values, then the image will not install correctly. For example:

    Dism /Capture-Image /ImageFile:C:\myimage.wim /CaptureDir:c:\ /Compress:fast /CheckIntegrity /Name:"Home" /Description:"Home reference installation"
    
  3. Replace the default Install.wim on the network share with your custom image. The image must be called Install.wim. For example:

    net use N: \\server\share\
    copy C:\myimage.wim N:\WindowsDVD\sources\install.wim
    

    If necessary, provide network credentials for appropriate network access.

For more information, see DISM Image Management Command-Line Options.

Step 4: Create a custom answer file

Create an answer file that points to your custom image. Answer files allow you to configure various settings in your image.

This step assumes that you've already built an answer file and have a working catalog. To learn how to create an answer file, see Create or open an answer file.

  1. On your technician computer, open Windows System Image Manager.

  2. On the File menu, click New Answer File.

  3. In the Windows Image pane of Windows SIM, expand the Components node to display available settings.

  4. Add the following components to your answer file by right-clicking the component and then selecting the appropriate configuration pass.

    Component Configuration Pass

    Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\ CreatePartition

    windowsPE

    Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ ModifyPartition

    windowsPE

    Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo

    windowsPE

    Tip

    Expand the component list until you see the lowest setting listed in the previous table, and then add that setting to your answer file. This shortcut will add the setting and all parent settings to your answer file in one step.

  5. All of the settings that you added must appear in the Answer File pane. Select and configure each setting as specified in the following table.

    Component Value

    Microsoft-Windows-Setup\DiskConfiguration

    WillShowUI = OnError

    Microsoft-Windows-Setup\DiskConfiguration\Disk

    DiskID = 0
    WillWipeDisk = true

    Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition

    Extend = false
    Order = 1
    Size = 300
    Type = Primary

    Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition

    Extend = true
    Order = 2
    Type = Primary

    Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition

    Active = true
    Extend = false
    Format = NTFS
    Label = System
    Letter = S
    Order = 1
    PartitionID = 1

    Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition

    Extend = false
    Format = NTFS
    Label = Windows
    Letter = C
    Order = 2
    PartitionID = 2

    Microsoft-Windows-Setup\ImageInstall\OSImage</strong>

    WillShowUI = OnError

    Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo

    DiskID = 0
    PartitionID = 2
  6. In a command prompt window copy the answer file to a network location. For example:

    net use N: \\server\share\
    md N:\AnswerFiles
    copy C:\deploy_unattend.xml N:\AnswerFiles\
    

    If necessary, provide network credentials for appropriate network access.

Step 5: Deploy the image by using Windows Setup

In this step, you will deploy your custom image from a network share onto a destination computer.

Important

If you're installing Windows 11, add the WinPE-WMI and WinPE-SecureStartup optional components to your WinPE image. If you don't include these optional components, you may see an error that your PC doesn't meet the minimum hardware requirements.

  1. Boot the destination computer by using your bootable Windows PE media.

  2. Connect to the network share that you specified in Step 4: Create a custom answer file, and then run Setup with your answer file. For example:

    net use N: \\server\share
    N:\WindowsDVD\setup /unattend:N:\AnswerFiles\deploy_unattend.xml
    

    If necessary, provide network credentials for appropriate network access.

Next Steps

You can further customize your answer file to include additional options. You can also build deployment media using the same content that's on the network share. Deployment media provides a portable installation solution that requires no network or any additional resources.

Important

The media that you create is for internal deployment use only. You cannot redistribute this media.