1 out of 1 rated this helpful - Rate this topic

How to Add an Application to Windows PE

Published: February 29, 2012

Updated: May 31, 2012

Applies To: Windows 8, Windows Server 2008 R2, Windows Server 2012

You can 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 deployment or validation process, you can include these tools in your custom Windows PE installation before you preinstall the operating system. You can add an application to an online or offline Windows PE image, or add an application to a Windows PE image for inclusion on bootable media.

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.

  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-image /imagefile:C:\winpe_amd64\winpe.wim /index:
        <1>
       /mountdir:C:\winpe_amd64\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_amd64\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_amd64\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, you can create a startup script by using a Winpeshl.ini file. For more information, see How to Include a Custom Script in Windows PE.

  7. After you modify the image, unmount the image, and then commit changes to the image. For example:

    Dism /unmount-image /mountdir:C:\winpe_amd64\mount /commit
    

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

  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_amd64\tools\
        <MyApp>
    

    where <MyApp> is the 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_amd64\tools\
        <MyApp>
    

    Alternatively, install applications in audit mode or by using an answer file.

  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.

  • 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
    
    noteNote
    This feature is only available offline. You cannot adjust this setting when a Windows PE session is running.

noteNote
If you remove an optional component by using the Dism /Remove-Package command, the Windows PE image no longer includes the optional component functionality. However, the source file still persists in the image. The size of the image remains the same. To remove the file from the image, you must create a new image.

For more information about DISM commands, see Deployment Image Servicing and Management (DISM) Command-Line Options.

See Also

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.