Create a Custom Windows PE Image
3/21/2011
To customize a Windows Preinstallation Environment (Windows PE) 3.0 image, you modify the base Windows PE image (Winpe.wim) by using the Deployment Image Servicing and Management (DISM) tool. DISM can be used to extract files to a local directory so that you can add and remove packages and add out-of-box drivers. For more information about DISM, see Deployment Image Servicing and Management Technical Reference.
Windows PE supports the following customizations:
- Adding and removing packages and language packs from the base image.
- Setting the target path for the Windows PE image.
- 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.
For more information about adding optional packages and language packs to Windows PE, see Optional Packages for Windows PE.
After customizing the image, you can copy or burn the image to bootable media. The typical method is to create an .iso file and then burn the image to CD-ROM. For more information about bootable methods, see Boot Windows PE from a RAM Disk.
To create a custom Windows PE image
Mount the base Windows PE image to a local directory by using DISM. Consider the following example.
dism /Mount-Wim /WimFile:C:\winpe_x86\winpe.wim /index:1 /MountDir:C:\winpe_x86\mount
Run DISM with the
/Get-Packages
option to see which packages are installed. Consider the following example.dism /image:C:\winpe_x86\mount /Get-Packages
Add packages and language packs by using DISM with the
/Add-Package
option. Consider the following example that shows how to add the HTA package that supports HTML applications. The example shows how to add both the language-neutral and language-specific packages.dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\ Windows Embedded Standard 7\Tools\PETools\x86\WinPE_FPs\WinPE-HTA.cab”Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows Embedded Standard 7\Tools\PETools\x86\WinPE_FPs\en-us\WinPE-HTA_en-us.cab”
Add drivers by using DISM with the
/Add-Driver
option. Consider the following example.dism /image:C:\winpe_x86\mount /Add-Driver /driver:C:\test\drivers\mydriver.inf
Add to the Mount directory the custom files or tools you want to include in the Windows PE image. Consider the following example that shows how to include ImageX.
copy "C:\Program Files\Windows Embedded Standard 7\Tools\x86\imagex.exe" C:\winpe_x86\mount\Windows\System32\
Commit the changes by using DISM with the
/Unmount-Wim /Commit
option. Consider the following example.dism /Unmount-Wim /MountDir:C:\winpe_x86\mount /Commit
Consider launching customized applications by using Winpeshl.ini, defining custom command-line scripts by using Startnet.cmd, or defining settings and actions by using an Unattend.xml answer file.
For more information, see Include a Custom Script in a Windows PE Image.
Consider designating temporary storage to support customized applications.
For more information, see Add an Application to a Windows PE Image.
Copy the custom image to the \ISO\sources directory and rename the file to Boot.wim. Consider the following example.
copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
See Also
Tasks
Create a Windows PE Build Environment
Boot Windows PE from a RAM Disk
Optimize a Windows PE Image