Add an Application to a Windows PE Image
Published: October 22, 2009
Updated: May 2, 2011
Applies To: Windows 7, Windows Server 2008 R2
|This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.|
The following procedure demonstrates how to add a custom application to a Windows® Preinstallation Environment (Windows PE) image offline. For example, if you have diagnostic software or custom tools that are a core part of your validation process, you can include these tools in your custom Windows PE installation before you preinstall the operating system.
To add an application to a Windows PE image offline
Ensure that you have sufficient memory to load and run your custom Windows PE image. If you have limited memory, define a page file (Pagefile.sys) to improve memory management. For more information about how to implement a page file, see Wpeutil Command-Line Options.
Mount the base image to a local Windows PE directory by using the DISM tool. For example:
Dism /Mount-WIM /WimFile:c:\winpe_x86\winpe.wim /index:<1> /MountDir:c:\winpe_x86\mount
Create an application directory inside the mounted Windows PE image. For example:
Copy the necessary application files to the local Windows PE directory. For example:
Xcopy C:\<MyApp> C:\Winpe_x86\Mount\Windows\<MyApp>
Repeat step 3 and step 4 for each additional custom application.
Optional: To start the application automatically when Windows PE boots, create a startup script by using a Winpeshl.ini file. For more information, see Include a Custom Script in a Windows PE Image.
After you modify the image, unmount the image, and then commit changes to the image. For example:
Dism /unmount-wim /Mountdir:c:\winpe_x86\mount /commit
To add an application to a Windows PE image for inclusion on bootable media
Copy the application to the \System32 folder of the Windows PE image.
- or -
Create a \Tools directory in a local Windows PE directory. Then, create an application directory inside the \Tools directory if the application directory does not already exist. For example:
Copy the necessary application files to the appropriate local Windows PE directory. For example:
xcopy C:\<MyApp> C:\Winpe_x86\Tools\<MyApp>
Repeat step 1 and step 2 for each additional custom application that you want to include with the Windows PE image on bootable media.
Burn the image to the designated media. For more information, see Windows PE Walkthroughs.
To increase scratch space for an offline image
If your application requires temporary storage, you can specify a custom scratch space as part of your image. For example, if Windows PE becomes unresponsive when Windows PE runs an application, the computer may have run out of memory. By default, Windows PE allocates 32 megabytes (MB) of writeable memory, known as scratch space.
Allocate additional memory by using the Dism command together with the /Set-ScratchSpace option. Valid sizes include 32, 64, 128, 256, or 512 megabytes (MB). The following example sets aside 128 MB of scratch space for the image in the C:\images\mounted directory.
Dism /image:C:\images\mounted\ /Set-ScratchSpace:128
|This feature is only available offline. You cannot adjust this setting when a Windows PE session is running.|