Compartilhar via


Walkthrough: Create a Custom 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.

This walkthrough describes how to create a customized Windows® PE image. The primary tool for customizing Windows PE 3.0 is Deployment Image Servicing and Management (DISM), a command-line tool. After creating a customized image, you can deploy the image to a hard disk or create a bootable Windows PE RAM disk on a CD-ROM, a USB flash drive (UFD), or a hard disk.

Note

A Windows PE RAM disk boots directly into memory and is assigned the drive letter X, which does not necessarily correspond to the media (for example, a UFD or a CD-ROM) from which you booted. Ensure that you have sufficient memory to support the size of your Windows PE image plus any additional memory requirements, such as any customized applications that need additional working memory. The minimum RAM requirement for Windows PE is 512 MB.

Prerequisites

To complete this walkthrough, you need the following:

  • A technician computer that provides all the tools and source files necessary to create a customized Windows PE image. For more information, see Building a Technician Computer.

  • Custom applications.

Step 1: Set Up a Windows PE Build Environment

In this step, you create a directory structure that supports building a Windows PE image. This directory structure is required.

  1. On your technician computer, click Start, point to All Programs, point to Windows OPK or Windows AIK, right-click Deployment Tools Command Prompt and then select Run as administrator.

    The menu shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools. By default, all tools are installed at C:\Program Files\version\Tools, where version can be Windows OPK or Windows AIK.

  2. At the command prompt, run the Copype.cmd script. The script requires two arguments: hardware architecture and destination location. For example,

    copype.cmd <architecture> <destination>
    

    where <architecture> can be x86, amd64, or ia64 and <destination> is a path to the local directory. For example,

    copype.cmd x86 c:\winpe_x86
    

    The script creates the following directory structure and copies all the necessary files for that architecture. For example,

    \winpe_x86
    \winpe_x86\ISO
    \winpe_x86\mount
    
  3. Copy the base image (winpe.wim) into \Winpe_x86\ISO\sources folder and rename the file to boot.wim.

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

Step 2: Mount the Base Windows PE Image

In this step, you mount the base image to a local directory so that you can add or remove packages.

  1. At the command prompt, mount the base Windows PE image to the \Mount directory by using DISM. For example,

    
    Dism /Mount-Wim /WimFile:C:\winpe_x86\ISO\sources\boot.wim /index:1 /MountDir:C:\winpe_x86\mount
    

Step 3: Add Optional Components

In this step, you will add optional components using the DISM /AddPackage option. When adding optional components, you must include both the language neutral package and language specific package. Windows PE 3.0 provides the following Windows 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 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 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. The winpe-xml package is now included in the base boot.wim.

  1. Add a Windows package to your custom image using the DISM /Add-Package option. In this example, you add both the language neutral package and language specific package.

    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\winpe-wmi.cab"
    
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\en-us\winpe-wmi_en-us.cab"
    
  2. Repeat Step 1 for each package you want to install in the base image.

  3. Verify that the packages were installed by using the DISM command with the /GetPackages option to view all packages in the current image. For example,

    Dism /image:c:\winpe_x86\mount /Get-Packages
    

Note

When using DISM to list the feature packages in a Windows PE image, the packages will always be listed as “pending” even when the servicing operation was successful. This is by design and requires no further action from you.

Step 4: Add Language Support

In this step, you can optionally add language support to your custom Windows PE image using the DISM /Add-Package option. By default, additional Windows PE language packs are not installed on your technician computer. You can obtain additional language packs from your Windows OPK or Windows AIK media under the \WinPE_LangPacks folder.

  1. Add the Windows PE language pack into your working directory. For example,

    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\en-us\lp_en-us.cab"
    
  2. Set the default language by using the /Set-AllIntl option with the following syntax. For example,

    Dism /image:C:\winpe_x86\mount /Set-AllIntl:en-US
    
  3. You can verify the language settings by using the /Get-Intl option. For example,

    Dism /image:c:\winpe_x86\mount /Get-Intl
    

Step 5: Add Additional Customizations

In this step, you can add applications and scripts to your Windows PE image that you might need while working in Windows PE. For more information see,

Step 6: Commit Changes to the Image

Commit changes to the image. In this step, you commit the changes to the original image file by using the DISM /unmount option with the /commit option. For example:

Dism /unmount-Wim /MountDir:C:\winpe_x86\mount /Commit

Next Step

You now have a customized Windows PE RAM disk image that you can place on bootable media, such as a CD-ROM or UFD.

To create a bootable CD-ROM

To create a bootable CD-ROM or DVD-ROM using custom Windows PE image, follow Step 3 of Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM topic.

To create a bootable UFD

To create a bootable UFD using custom Windows PE image, follow Step 3 of Walkthrough: Create a Bootable Windows PE RAM Disk on a USB Flash Disk topic.

See Also

Concepts

Building a Windows PE Image
Booting Windows PE