Capturing and Optimizing a Build
After your Windows PE image is ready, you can use the following ImageX command to capture the image into a Windows Imaging (.wim) file:
imagex /boot /capture c:\winpe_x86\mount c:\winpe_x86\iso\sources\boot.wim
"Primary WinPE Build"
Here, the /Boot option marks the image as bootable, and the /Capture option captures the contents of C:\Winpe_x86\Mount and creates an image file in the C:\Winpe_x86\ISO\Sources directory. "Primary WinPE Build" is the descriptive name of the bootable image file (Boot.wim).
Note WIM images can be bootable or installable. Generally, bootable images, used with Windows pe, are stored in Boot.wim files, and installable images, used to deploy Windows, are stored in Install.wim files. Install.wim files can include multiple editions of Windows. the standard Windows 7 distribution media contains a Boot.wim file and an Install.wim file. the Boot.wim file loads Windows pe to start the computer and prepare for installation. the Install.wim file contains the Windows image needed to install Windows 7.
The ISO\Sources directory is a standard build directory used for staging Windows PE images. The ISO directory also has Boot and EFI subdirectories, which are required for creating bootable media. After you've staged the boot image, you can create bootable media that uses the image or you can import the image into Windows Deployment Services.
Optimizing a Build
Profiling tracks the required components for a build and then allows you to optimize a build image. To use profiling, you must install the WinPE-WMI package and enable the feature by using the /Enable-Profiling option in the Windows PE image. Enabling profiling turns on logging of the files and features that are used when you boot to the Windows PE image.
After you boot to the Windows PE image, test all the features you are going to use in the actual environment. Testing the features shows the related files as being used in the profile log. You can save the profile using Wpeutil SaveProfile before ending the Windows PE session. The basic syntax is:
wpeutil saveprofile SaveLocation "Description"
where SaveLocation is the file path where the profile should be stored, and Description is a description of the profile, for example:
wpeutil saveprofile x:\st-profile.txt "Optimization Profile"
Next, you need to mount the image and apply the profile. The basic syntax for applying a profile to a mounted image is:
dism /image:ImagePath /apply-profiles:ProfilePath
where ImagePath is the path to the image you've mounted, and ProfilePath is the path to the profile you want to use to optimize the image, such as:
dism /image:c:\winpe_x86\mount\ /apply-profiles:c:\st-profile.txt
Once you've optimized the image, unmount the image and commit the changes. Note that applying a profile turns off the profiling features and marks the image so that it can no longer be serviced.
In this tutorial:
- Deploying Windows 7
- Working with Windows PE
- Understanding Windows pe
- Configuring Windows PE
- Preparing a Build environment
- Creating a Build: the essentials
- Mounting a Windows pe Image
- Customizing a Windows PE Image
- Capturing and Optimizing a Build
- Creating a Bootable ISO Image and Bootable Media
- Creating a Bootable USB Flash Drive
- Booting to an Image from a hard Disk
- Adding Windows pe Images to Windows Deployment Services
- Working with Windows RE
- Creating a Customized Windows RE Image
- Creating Windows re recovery Media
- Adding Windows RE Images to Windows Deployment Services
- Deploying Windows with a Customized Windows RE
- Creating Windows Images for Deployment
- Understanding Windows Imaging
- Creating a Windows Install Image
- Configuring and Using Windows Deployment Services
- Setting Up Windows Deployment Services
- Importing Images
- Installing Windows from an Image
- Capturing Images
- Managing access and prestaging Computers
- Modifying Image File Security
- Customizing Windows Images