Поделиться через


Add an Application to 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 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

  1. 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.

  2. 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
    

    where <1> is the number of the selected image on the .wim file.

  3. Create an application directory inside the mounted Windows PE image. For example:

    md C:\Winpe_x86\Mount\Windows\<MyApp>
    

    where <MyApp> is your custom application.

  4. Copy the necessary application files to the local Windows PE directory. For example:

    Xcopy C:\<MyApp> C:\Winpe_x86\Mount\Windows\<MyApp>
    
  5. Repeat step 3 and step 4 for each additional custom application.

  6. 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.

  7. 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
    

    After you unmount the image, you can burn the image to the designated media. For more information, see Windows PE Walkthroughs.

To add an application to a Windows PE image for inclusion on bootable media

  1. 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:

    md C:\Winpe_x86\Tools\<MyApp>
    

    where <MyApp> is name of your custom application.

  2. Copy the necessary application files to the appropriate local Windows PE directory. For example:

    xcopy C:\<MyApp> C:\Winpe_x86\Tools\<MyApp>
    

    Alternatively, install applications in audit mode or by using an answer file. For more information, see Add an Application.

  3. Repeat step 1 and step 2 for each additional custom application that you want to include with the Windows PE image on bootable media.

  4. 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

Note

This feature is only available offline. You cannot adjust this setting when a Windows PE session is running.

See Also

Concepts

Deployment Image Servicing and Management Command-Line Options
Application Servicing Command-Line Options
Windows PE Servicing Command-Line Options