Windows 7 / Getting Started

Windows 7 Working with PE

Most Windows PE tasks have just a few basic steps. Applications and customizations might vary the process somewhat, but the basic process is the same. This section gives you an overview of the Windows PE build process. In later sections, you learn how to customize Windows PE in greater depth.

Mounting Windows PE

After you create the Windows PE build environment, the first step in customizing the Windows PE-based image is to mount it so that you can service it by using DISM. An example of the command to mount the base image is here (where 1 is the image number within Winpe.wim to be mounted and C:\Winpe_x86\Mount is the path on which to mount it):

Dism /Mount-Wim /WimFile:C:\Winpe_x86\Winpe.wim /Index:1 /MountDir:C:\Winpe_x86\Mount

Note With previous versions of Windows PE, you couldn't service the image after you ran peimg /prep. This is no longer true with Windows PE 3.0. You can now mount and service Windows PE images as required.

Adding Packages

The next step is to add the packages that you require. You add packages by using the DISM /Add-Package option. Additionally, for every feature you want to add to Windows PE, you must add a language-neutral package and a language-specific package. In a default installation of the Windows AIK, you find the language-neutral packages in the folder C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs and the language-specific packages in C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\language, where language is the language identifier (such as en-US for U.S. English).

To add a package to the Windows PE image, perform the following steps:

  1. Look up in Table 9-1 the names of the packages that you want to install.
  2. Add the language-neutral package to the Windows PE image by running the following command at the Deployment Tools command prompt.
    dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows
    AIK\Tools\PETools\x86\WinPE_FPs\package.cab"
  3. Add the language-specific package to the Windows PE image (look up the actual file name in C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us).
    dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows
    AIK\Tools\PETools\x86\WinPE_FPs\language\package_language.cab"

For example, the following two commands install the WinPE-Scripting language-neutral and language-specific packages into a Windows PE image mounted at C:\Winpe_x86\Mount.

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK
\Tools\PETools\x86\WinPE_FPs\winpe-scripting.cab"

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK
\Tools\PETools\x86\WinPE_FPs\en-us\winpe-scripting_en-us.cab"

After adding packages to the Windows PE image, you can verify them by listing the image's packages. To list the packages in a Windows PE image mounted to C:\Winpe_x86\Mount, run the following command at the Deployment Tools command prompt.

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

Windows PE Packages

PackagePackage
WinPE-FONTSupport-<language>Provides additional font support for the following languages: ja-JP, ko-KR, zh-CN, zh-HK, and zh-TW.
WinPE-HTAProvides HTA support. Enables the creation of graphical user interface (GUI) applications using the Windows Internet Explorer script engine and HTML services.
Winpe-LegacySetupContains the Media Setup 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 package. To add a new Boot.wim to the media, add either child package in addition to the Setup and Media packages.
WinPE-MDACProvides Microsoft Data Access Component support. Enables queries to SQL servers with Active Directory Objects. For example, you can build a dynamic Unattend.xml file from unique system information.
WinPE-PPPoEEnables Point-to-Point Protocol over Ethernet (PPPoE) support. Create, connect, disconnect, and delete PPPoE connections from Windows PE.
WinPE-ScriptingProvides WSH support. Enables batch file processing using WSH script objects.
WinPE-SetupContains the Setup package. All Setup files from the \Sources folder common to the client and server. This package is the parent package of winpe-setup-client and winpe-setup-server. You must install winpe-setup before you install the child packages.
WinPE-Setup-ClientContains the Client Setup package. The client branding files for Setup. Must be added after the WinPE-Setup package.
WinPE-Setup-ServerContains the Server Setup package. The server branding files for Setup. Must be added after the WinPE-Setup package.
WinPE-SRTContains the Windows Recovery Environment (Windows RE) package. Provides a recovery platform for automatic system diagnosis and repair and the creation of custom recovery solutions.
WinPE-WMIProvides Windows Management Instrumentation (WMI) support. A subset of the WMI providers that enables minimal system diagnostics.
WinPE-WDS-ToolsContains the Windows Deployment Services tools package. Includes APIs to enable a multicast scenario with a custom Windows Deployment Services client and Image Capture utility.

Note Previous versions of Windows PE included pre-staged optional packages that you had to remove if you didn't want to include them in the image. These included the WinPE-HTA-Package, WinPE-Scripting-Package, and WinPE-MDAC-Package packages. Windows PE 3.0 does not include pre-staged optional features, helping reduce the footprint of Windows PE. You must add all of the packages that you require.

Copying Applications

You can also copy applications into the Windows PE image so that you can use them during the Windows 7 implementation process. To copy an application into a Windows PE image, use operating system copy commands to copy the application to the appropriate location.

xcopy /chery myapp.exe "c:\winpe_x86\mount\program files\myapp\myapp.exe"

Adding Device Drivers

Windows PE can use Windows 7 device drivers to provide hardware support for Windows 7 installation processes. Use the DISM /Add-Drive option to add device drivers to the Windows PE image (inf_file is the path and file name of the device driver's .inf file).

Dism /image:c:\winpe_x86\mount /Add-Driver /Driver:inf_file

Windows PE can also add device drivers dynamically when running. Use the Drvload.exe command to load device drivers while operating.

drvload.exe path[,path]

Installing Updates

You install updates to Windows PE using the same process by which you add features: You use the DISM /Add-Package option. Run the following command at the Deployment Tools command prompt, where update_file is the path and file name of the update.

dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:update_file

Committing the Changes

After customizing the mounted Windows PE image, you must dismount the image and commit your changes. This saves your changes into the Winpe.wim file that you mounted. Before dismounting the image, make sure you close any open files and Windows Explorer windows that might prevent you from successfully committing your changes.

To capture the Windows PE image, use the following command.

dism /unmount-Wim /MountDir:C:\winpe_x86\mount /Commit
[Previous] [Contents] [Next]