Best Practices for Servicing
The following are recommendations for deploying and servicing Windows images.
All command-line tools require elevated permissions. ImageX does not prompt for consent or credentials. It fails if you try to mount an image with read/write permission without running the program under elevated permissions.
To make sure you have elevated permissions
In Windows Vista, on the Start menu, point to All Programs, and then click Accessories.
Right-click Command Prompt, and then click Run as administrator.
This must be done even if you are logged on as an administrator.
You cannot mount an image with read/write permission or mount an image in Windows PE and run Package Manager. If you are servicing an image in Windows PE, you must apply the image to service the image with Package Manager.
If you are adding an out-of-box system MSI with OCSetup, the system MSI must first be staged. If you are installing a package online with OCSetup, use an unattended installation answer file. The path can be specified in the servicing section of the answer file. For more information, see OCSetup Command-Line Options.
The path to your packages must be short: the path to the offline installation must not exceed 100 characters. This includes the file names inside the package, which can easily be 60–100 characters. Basically, you must create a folder with five or fewer characters at the root of the desired partition.
Do not put a package that you intend to install directly at the root of a partition on a Windows Vista installation.
When using Pkgmgr.exe with the /l option, a plain text log is created at the location that you specify. For example:
This command will create Mylog.log, a WPP trace log, and also Mylog.log.txt, a plain text log.
The default logs are located at %WINDIR%\logs\cbs\cbs.log. Setupact.log is a full log, and Setuperr.log logs only errors.
Logging does not work when installing from read-only media, such as a Windows PE CD.
Servicing a Windows Image in Windows PE
You can service Windows images from Windows PE. However, you must consider certain factors while planning your servicing strategy. For example, additional storage space is required to process updates. Review the following requirements for servicing an image from Windows PE.
Booting Windows PE from a Hard Drive
For better performance, you can allocate additional memory when you boot Windows PE from a hard disk drive. You can also create temporary folders to store update files to accommodate large updates.
Add page file support to your Windows PE image
Make sure you have sufficient memory to load and run your custom Windows PE image. In addition to the image size, you should have at least 256 MB of available working memory. If you have limited memory, define a page file (Pagefile.sys) to improve memory management. For more information on implementing a page file, see Wpeutil Command-Line Options.
Create a temporary directory in which to store update files
Windows PE 2.0 creates this temporary directory automatically.
This temporary directory is used for installing language packs, updates, or installing or removing Windows features in a Windows image. Some of the files are expanded to this temporary directory before the update is applied to a Windows image. There must be sufficient space in the partition to accommodate large updates. The specific size of the free space that is required depends on the size of the updates that you intend to install.
You can allocate additional temporary storage using the peimg /scratchspace command. Valid sizes include 32, 64, 128, 256, or 512 megabytes (MB). This feature is only available offline. You cannot adjust this setting while a Windows PE session is running.When using Package Manager to service an applied image, use the /s: <sandbox_directory> command to extract files. This directory is used for temporary storage. After installation is complete, the contents of this directory are no longer needed and can be deleted. For more information, see Package Manager Command-Line Options.
Booting Windows PE from a CD-ROM/DVD
Servicing a Windows image requires additional temporary storage space. For Windows PE RAM disks, additional RAM is recommended. In addition to the RAM requirements of your Windows PE image, additional RAM is required to process updates. The amount of RAM that is required varies and depends on the size of the updates that you intend to apply. Ensure that your computer has sufficient RAM.
Verify the Integrity of System Files
Before you deliver a computer to an end user, you must verify the integrity of Windows system files by using System File Checker (Sfc.exe). Sfc.exe is released with all versions of Windows. Typically, you must verify only the integrity of the Windows system files with the sfc.exe /verifyonly option. It is not recommended that you use the Sfc.exe scan options to automatically fix Windows system files.
System File Checker scans all protected files to verify the file versions. You must be logged on as an administrator or as a member of the Administrators group to run System File Checker.
Running Sfc.exe can take a significant amount of time. You must run Sfc.exe only on your reference images.
The expected result is that there are no system integrity violations. However, if there are problems with Windows system files, you must investigate the issue.
For complete command-line syntax, in Windows Vista, at a command prompt, type sfc.exe /?.