Share via


Walkthrough: Create a Windows RE Image

This walkthrough describes how to build a Windows Recovery Environment (Windows RE) image. Windows RE is a solution based on Windows PE 2.0. In this example, you create a customized Windows RE image on your technician computer.

Important

This walkthrough outlines how to build the Windows RE solution, not a complete Windows Vista image. You must still create a separate Windows Vista installation.

This walkthrough illustrates a hidden (type 0x27) Windows RE disk configuration. In the following illustration, the Windows RE partition is located in front of the Windows Vista partition.

Windows RE-only (hidden)

Windows RE

Type 0x27

1GB

Windows Vista

Type 0x7

(active)

There are other Windows RE disk configurations that coexist with Bitlocker Drive Encryption. For more information on disk configurations, see Preinstallation Design.

Prerequisites

To complete this walkthrough, you will need the following:

  • A technician computer that provides all the tools and the source files. For more information, see Building a Technician Computer.
  • An authorized copy of a Windows Vista product DVD.

Step 1: Set up a Windows PE build environment

In this step, you create a directory structure that supports building a Windows PE image. You apply a Windows PE image to the \Mount directory so that you can add Windows RE customizations.

  1. On your technician computer, click Start, point to AllPrograms, then Windows OPK or Windows AIK, and then click Windows PE Tools Command Prompt.
    The menu shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools.

  2. At the command prompt, run the Copype.cmd script. The script requires two arguments, hardware architecture and destination location.

    copype.cmd <architecture> <destination>
    

    where <architecture> can be x86, amd64, or ia64 and <destination> is a path to the local directory. For example,

    copype.cmd x86 c:\winre_x86
    

    The script creates the directory structure and copies all the necessary files for that architecture. For example,

    \winre_x86
    \winre_x86\ISO
    \winre_x86\mount
    
  3. In this step, you mount a Windows PE image. For Windows OPK customers, you modify the base Windows PE image (Winpe.wim). For Windows AIK customers, you modify the default Windows RE image available from your Windows Vista product DVD.

Important

Windows AIK does not support the creation of a Windows RE solution by using the base Windows PE image (Winpe.wim).

For Windows OPK, use the ImageX **/apply** option (or **mountrw** command) to mount the base Windows PE image. For example,  

    imagex /apply c:\winre_x86\winpe.wim 1 c:\winre_x86\mount

For Windows AIK, copy and mount the Windows PE image from the Windows Vista product DVD by using ImageX and skip Step 2. For example,  

    imagex.exe /export /boot <DVD_Drive>\sources\boot.wim 2 c:\winre_x86\winre.wim “Windows Recovery Environment”
    imagex.exe /mountrw c:\winre_x86\winre.wim 1 c:\winre_x86\mount

Step 2: Add Windows PE packages (Windows OPK only)

This step is required only for Windows OPK. In this step, you use the Peimg tool to add all the required Windows PE packages to your customized image. Windows PE packages are included with the base image (Winpe.wim) but are not installed. You must explicitly install the packages by using the peimg /install command. You can also import packages and add language packs. For more information, see Windows PE Customization How-To Topics.

  1. In a Windows PE Tools Command Prompt window, type the following,

    peimg.exe /install=WinPE-SRT* C:\winre_x86\mount\Windows 
    peimg.exe /install=WinPE-Scripting* C:\winre_x86\mount\Windows
    peimg.exe /install=WinPE-WMI* C:\winre_x86\mount\Windows
    
  2. Verify that the components were installed by using the peimg /list command to view all packages in the current image. For example,

    peimg /list c:\winre_x86\mount\Windows
    

    In the INS column, (+) denotes installed packages and (-) denotes not installed.

Step 3: Add custom Windows RE scripts

In this step, you add a customized Windows RE scripts to your image. You create a script called Winpeshl.ini that will launch the Windows RE shell during a failover.

  1. By using a text editor, create a file called Winpeshl.ini. For example,

    [LaunchApp]
    AppPath=X:\sources\recovery\recenv.exe
    
  2. Copy the file to the \Windows\System32 directory in your working Windows PE directory. For example,

    copy winpeshl.ini C:\winre_x86\mount\Windows\System32
    

Step 4: (Optional) Add mass-storage drivers

If necessary, you can include third-party drivers (.inf files) in your Windows RE image by using the peimg.exe /inf command. For example,

peimg.exe /inf=<path> C:\winre_x86\mount\Windows

where <path> is the location of the. inf file.

Step 5: Add custom tools to Windows RE

This step is optional for Windows Vista, but required for Windows Server 2008. Specifically, you must enable the server mode for Windows RE. For more information, see Customizing the Windows RE Experience.

You can customize Windows RE shell by creating an .xml file called WinREConfig.xml. WinREConfig.xml enables you to define customized support and diagnostic tools within Windows RE. For example, you can provide an option to reinstall the factory image if Windows RE is unable to recover the system.

Step 6: Capture the image

In this step, you capture all the customization back into a Windows image (.wim) file.

  • For Windows OPK, in a Windows PE Tools Command Prompt window, capture your customizations by using ImageX. For example,

    imagex.exe /capture c:\winre_x86\mount C:\winre_x86\winre.wim "Windows RE Image" /boot /compress max
    
  • For Windows AIK, in a Windows PE Tools Command Prompt window, commit your customizations and unmount the image by using ImageX. For example,

    imagex.exe /unmount /commit c:\winre_x86\mount
    

Next Step

This completes the first part of building a Windows RE solution. You can deploy the image onto a hard drive or recovery media, like a CD-ROM.

See Also

Concepts

Customization Walkthroughs
Walkthrough: Create a Windows RE Recovery Media
Walkthrough: Deploy a Windows RE Image on Hard Drive