How to Add an Optional Component to Windows PE

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

Packages are optional components. You can add optional components to a Windows® Preinstallation Environment (Windows PE) image offline by using the Deployment Image Servicing and Management (DISM) tool. By default, the base Windows PE image does not contain optional components. You must add each optional component to your image by using the Dism command together with the /Add-Package option. When you do this, you must include both the language-neutral optional component and the language-specific optional component. For a list of optional components that you can add to your base image, see Building a Windows PE Image with Optional Components.

Add an Optional Component to a Base Windows PE Image

Selecting an optional component or language pack in Windows System Image Manager (SIM) or copying an optional component directly from a subfolder of your Windows® Assessment and Deployment Kit (Windows ADK) installation does not install the optional component to the base image. These methods only copy the files to the disk so that the files are available for later addition to the image. You must use the Dism command together with the /Add-Package option to install optional components on your offline image. Likewise, you must add subcomponents individually.

Important

Some optional components have dependencies. For more information, see Building a Windows PE Image with Optional Components.

To add an optional component

  1. Use the DISM tool to mount the base image to a local Windows PE directory. For example:

    Dism /mount-image /imagefile:C:\winpe_amd64\winpe.wim /index:
        <1>
       /mountdir:C:\winpe_amd64\mount
    

    where <1> is the number of the selected image on the .wim file.

  2. Add a Windows feature to the base image by using the Dism command together with the /Add-Package option. As shown in the following examples, you must add the language-neutral optional component, and then add the language-specific optional component.

      Dism /image:C:\winpe_amd64\mount /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-wmi.cab" 
    
      Dism /image:C:\winpe_amd64\mount /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\winpe-wmi_en-us.cab"
    
      Dism /image:C:\winpe_amd64\mount /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-hta.cab"
    
      Dism /image:C:\winpe_amd64\mount /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\winpe-hta_en-us.cab"
    

    Note

    When you add optional components, you must include both the language-neutral optional component and the language-specific optional component. You must add the language-neutral optional component first.

  3. Optional: To obtain a list of installed optional components, use the /Get-Packages option.

  4. Repeat Step 2 for each optional component that you want to install in the base image.

  5. View all optional components in the current image to verify that the optional components were installed by using the Dism command together with the /Get-Packages option. For example:

    Dism /image:C:\winpe_amd64\mount /get-packages
    
  6. After you modify the image, unmount the image, and then commit changes to the image. For example:

    Dism /unmount-image /mountdir:C:\winpe_amd64\mount /commit
    
  7. Optional: After the image is prepared, copy the image to the removable media or fixed storage. For more information, see Walkthrough: Install Windows PE to CD, USB Flash Drive, or USB Hard Drive or Walkthrough: Flat-Boot Windows PE.

Note

If you remove a optional component by using the Dism /Remove-Package command, the Windows PE image no longer includes the optional component functionality. However, the source file still persists in the image. The size of the image remains the same. To remove the file from the image, you must create a new image.

For more information about how to manage optional components, see Operating System Package Servicing Command-Line Options.

For an example of how to build custom Windows PE images, see Windows PE Walkthroughs.

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

See Also

Tasks

How to Configure Windows Firewall with Advanced Security Settings in Windows PE
How to View Current Optional Components in Windows PE
How to Add a Language Pack to Windows PE
How to Add an Optional Component to Windows PE
How to Add an Application to Windows PE
How to Include a Custom Script in Windows PE
How to Add Device Drivers to an Online Windows PE Image
How to Add Device Drivers to an Offline Windows PE Image