Share via


Building a Windows PE Image

Applies To: Windows 7, Windows Server 2008 R2

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

The first step in creating a customized Windows® PE 3.0 image is to modify the base Windows PE image (winpe.wim) by using the Deployment Image Servicing and Management (DISM) tool. DISM extracts the files to a local directory and enables you to add and remove packages (optional components and language packs). In addition, you can add out-of-box drivers. DISM provides the same mounting and unmounting operations as ImageX.

The following diagram illustrates how a custom Windows PE image is built.

The general process for creating a custom Windows PE image includes:

  1. Mount the base image by using the DISM tool to a local directory share. For example,

    Dism /Mount-Wim /WimFile:C:\winpe_x86\winpe.wim /index:1 /MountDir:C:\winpe_x86\mount
    
  2. Using the Dism command with the /Get-Package option to see which packages are installed. For example,

    Dism /image:C:\winpe_x86\mount /Get-Packages
    
  3. Add packages, and language packs as appropriate by using the Dism command with the /Add-Package option. For example, to add the HTA package you must add both the language neutral package along with the language specific package. For example:

    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\WinPE-HTA.cab"
    
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\en-us\WinPE-HTA_en-us.cab"
    

    Where <version> can be the OEM Preinstallation Kit (Windows OPK) or the Automated Installation Kit (Windows AIK). When a Windows PE feature package is added, the feature is automatically enabled.

  4. Add drivers as appropriate by using the Dism command with the /Add-Driver option. For example:

    Dism /image:C:\winpe_x86\mount /Add-Driver /driver:C:\test\drivers\mydriver.inf
    
  5. Add any additional custom files or tools that you intend to include in the image within the \mount directory. For example, you can include ImageX within your image,

    copy "C:\Program Files\<version>\Tools\x86\imagex.exe" C:\winpe_x86\mount\Windows\System32\
    

    Where <version> can be Windows OPK or Windows AIK.

  6. Commit the changes using the Dism command with the /Unmount-Wim /Commit option. For example,

    Dism /Unmount-Wim /MountDir:C:\winpe_x86\mount /Commit 
    
  7. Copy your custom image into \ISO\sources folder and rename to boot.wim. For example,

    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
    

The customized image is now ready to be copied or burned to bootable media. The most common method is to create an .iso file and then burn the image onto a CD-ROM. For more information about bootable methods, see Booting Windows PE.

Supported Packages

Windows PE 3.0 provides the following optional packages:

Package Name Description

WinPE-FONTSupport-<region>

Additional font support for the following languages: ja-JP, ko-KR, zh-CN, zh-HK, and zh-TW.

WinPE-HTA

HTML Application support. Enables the creation of GUI applications using the Windows Internet Explorer® script engine and HTML services.

Winpe-LegacySetup

The Media Setup feature package. All Setup files from the \Sources folder on the Windows media. Add this package when servicing Setup or the \Sources folder on the Windows media. Must be added with the Setup feature package. To add a new Boot.wim to the media, add either child package in addition to the Setup and Media packages. This package is required to support Windows Server® 2008 R2 installation.

WinPE-MDAC

Microsoft® Data Access Component support. Enables queries to SQL servers with Active Directory Objects (ADO). Example usage: building a dynamic Unattend from unique system information.

WinPE-PPPoE

Enables Point-to-Point Protocol over Ethernet (PPPoE) support. Create, connect, disconnect and delete PPPoE connections from Windows PE.

WinPE-Scripting

Windows Script Host (WSH) support. Enables batch file processing using WSH script objects.

WinPE-Setup

The Setup feature package (parent). All Setup files from the \Sources folder common to Client and Server.

WinPE-Setup-Client

The Client Setup feature package (child). The Client branding files for Setup. Must be added after the Setup feature package.

WinPE-Setup-Server

The Server Setup feature package (child). The Server branding files for Setup. Must be added after the Setup feature package.

WinPE-SRT

The Windows Recovery Environment feature package. Provides a recovery platform for automatic system diagnosis and repair and the creation of custom recovery solutions.

WinPE-WMI

Windows Management Instrumentation (WMI) support. A subset of the WMI providers that enables minimal system diagnostics.

WinPE-WDS-Tools

The Windows Deployment Services tools feature package. Includes APIs to enable a multicast scenario with a custom Windows Deployment Services client and Image Capture utility.

Note

  • The base Windows PE image does not contain all the packages listed above. You must use the DISM tool to install the appropriate packages. The packages are located in the directory \Windows OPK\Tools\PETools\_architecture or \Windows AIK\Tools\PETools\_architecture. For your optional components to work correctly, make sure the required language resources are installed on the client computer. The language resources are located in a folder with the same name as the language installed in the directory listed above.

  • The winpe-xml package is now included in the base boot.wim.

  • The Windows PE-setup-package is the parent package of winpe-setup-client and winpe-setup-server. You must install winpe-setup before you install the child packages.

    Supported Customizations

    Windows PE 3.0 supports the following customizations:

    • Adding and removing packages and language packs from the base image.

    • Setting Windows PE image target path.

    • Enabling or disabling file tracing.

    • Adding third-party drivers and third-party components.

    • Adding Windows PE updates.

    • Adding out-of-box Windows PE language packs.

    • Customizing temporary storage.

    Customizing the Windows PE Environment

    You can customize your Windows PE image to include specific environment settings when Windows PE boots up. For example, you can define specific network requirements, run customized scripts, or start customized applications. You can define these settings by using a combination of Winpeshl.ini, Startnet.cmd, and Unattend.xml.

    You can launch customized applications by using Winpeshl.ini, define custom command-line scripts by using Startnet.cmd, and define various Windows PE settings and actions by using Unattend.xml. For more information, see Include a Custom Script in a Windows PE Image.

    You can designate temporary storage to support customized applications. For more information, see Add an Application to a Windows PE Image.

    If your Windows PE environment becomes unresponsive when running an application, you may have run out of memory. By default, Windows PE allocates 32 megabytes (MB) of writeable memory, known as scratch space. You can increase the scratch space up to 512 MB by typing the following at a command prompt:

    dism /image:<mounted_image_path> /Set-ScratchSpace:<size>
    

    Where size can be any one of the following values: 32, 64, 128, 256 and 512.

    See Also

    Concepts

    Booting Windows PE
    Windows PE Customization How-To Topics
    Windows PE Walkthroughs