34
Deployment Labs Microsoft® Corporation October 2009 Summary: This document provides instructions on deploying Windows® 7 by using the latest Windows 7 OEM Preinstallation Kit® (OPK). Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved. These materials are confidential to and maintained as a trade secret by Microsoft Corporation. Information in these materials is restricted to Microsoft authorized recipients only. Any use, distribution, or public discussion of, and any feedback to, these materials are subject to the terms of the attached license. By providing any feedback on these materials to Microsoft, you agree to the terms of that license.

Sbc Windows 7 Deployment Labs

Embed Size (px)

Citation preview

Page 1: Sbc Windows 7 Deployment Labs

Deployment Labs

Microsoft® Corporation

October 2009

Summary: This document provides instructions on deploying Windows® 7 by using the latest Windows 7 OEM Preinstallation Kit® (OPK).

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved. These materials are confidential to and maintained as a trade secret by Microsoft Corporation. Information in these materials is restricted to Microsoft authorized recipients only. Any use, distribution, or public discussion of, and any feedback to, these materials are subject to the terms of the attached license. By providing any feedback on these materials to Microsoft, you agree to the terms of that license.

Page 2: Sbc Windows 7 Deployment Labs

Microsoft Corporation Technical Documentation License Agreement (Standard)

READ THIS! THIS IS A LEGAL AGREEMENT BETWEEN MICROSOFT CORPORATION ("MICROSOFT") AND THE RECIPIENT OF THESE

MATERIALS, WHETHER AN INDIVIDUAL OR AN ENTITY ("YOU"). IF YOU HAVE ACCESSED THIS AGREEMENT IN THE PROCESS OF

DOWNLOADING MATERIALS ("MATERIALS") FROM A MICROSOFT WEB SITE, BY CLICKING "I ACCEPT", DOWNLOADING, USING OR

PROVIDING FEEDBACK ON THE MATERIALS, YOU AGREE TO THESE TERMS. IF THIS AGREEMENT IS ATTACHED TO MATERIALS, BY

ACCESSING, USING OR PROVIDING FEEDBACK ON THE ATTACHED MATERIALS, YOU AGREE TO THESE TERMS.

1. For good and valuable consideration, the receipt and sufficiency of which are acknowledged, You and Microsoft agree as follows:

(a) If You are an authorized representative of the corporation or other entity designated below ("Company"), and such Company has

executed a Microsoft Corporation Non-Disclosure Agreement that is not limited to a specific subject matter or event ("Microsoft NDA"), You

represent that You have authority to act on behalf of Company and agree that the Confidential Information, as defined in the Microsoft NDA,

is subject to the terms and conditions of the Microsoft NDA and that Company will treat the Confidential Information accordingly;

(b) If You are an individual, and have executed a Microsoft NDA, You agree that the Confidential Information, as defined in the Microsoft NDA,

is subject to the terms and conditions of the Microsoft NDA and that You will treat the Confidential Information accordingly; or

(c) If a Microsoft NDA has not been executed, You (if You are an individual), or Company (if You are an authorized representative of

Company), as applicable, agrees: (a) to refrain from disclosing or distributing the Confidential Information to any third party for five (5) years

from the date of disclosure of the Confidential Information by Microsoft to Company/You; (b) to refrain from reproducing or summarizing the

Confidential Information; and (c) to take reasonable security precautions, at least as great as the precautions it takes to protect its own

confidential information, but no less than reasonable care, to keep confidential the Confidential Information. You/Company, however, may

disclose Confidential Information in accordance with a judicial or other governmental order, provided You/Company either (i) gives Microsoft

reasonable notice prior to such disclosure and to allow Microsoft a reasonable opportunity to seek a protective order or equivalent, or (ii)

obtains written assurance from the applicable judicial or governmental entity that it will afford the Confidential Information the highest level

of protection afforded under applicable law or regulation. Confidential Information shall not include any information, however designated,

that: (i) is or subsequently becomes publicly available without Your/Company’s breach of any obligation owed to Microsoft; (ii) became known

to You/Company prior to Microsoft’s disclosure of such information to You/Company pursuant to the terms of this Agreement; (iii) became

known to You/Company from a source other than Microsoft other than by the breach of an obligation of confidentiality owed to Microsoft; or

(iv) is independently developed by You/Company. For purposes of this paragraph, "Confidential Information" means nonpublic information

that Microsoft designates as being confidential or which, under the circumstances surrounding disclosure ought to be treated as confidential

by Recipient. "Confidential Information" includes, without limitation, information in tangible or intangible form relating to and/or including

released or unreleased Microsoft software or hardware products, the marketing or promotion of any Microsoft product, Microsoft's business

policies or practices, and information received from others that Microsoft is obligated to treat as confidential.

2. You may review these Materials only (a) as a reference to assist You in planning and designing Your product, service or technology

("Product") to interface with a Microsoft Product as described in these Materials; and (b) to provide feedback on these Materials to Microsoft.

All other rights are retained by Microsoft; this agreement does not give You rights under any Microsoft patents. You may not (i) duplicate any

part of these Materials, (ii) remove this agreement or any notices from these Materials, or (iii) give any part of these Materials, or assign or

otherwise provide Your rights under this agreement, to anyone else.

3. These Materials may contain preliminary information or inaccuracies, and may not correctly represent any associated Microsoft Product as

commercially released. All Materials are provided entirely "AS IS." To the extent permitted by law, MICROSOFT MAKES NO WARRANTY OF

ANY KIND, DISCLAIMS ALL EXPRESS, IMPLIED AND STATUTORY WARRANTIES, AND ASSUMES NO LIABILITY TO YOU FOR ANY DAMAGES OF

ANY TYPE IN CONNECTION WITH THESE MATERIALS OR ANY INTELLECTUAL PROPERTY IN THEM.

4. If You are an entity and (a) merge into another entity or (b) a controlling ownership interest in You changes, Your right to use these

Materials automatically terminates and You must destroy them.

5. You have no obligation to give Microsoft any suggestions, comments or other feedback ("Feedback") relating to these Materials. However,

any Feedback you voluntarily provide may be used in Microsoft Products and related specifications or other documentation (collectively,

"Microsoft Offerings") which in turn may be relied upon by other third parties to develop their own Products. Accordingly, if You do give

Microsoft Feedback on any version of these Materials or the Microsoft Offerings to which they apply, You agree: (a) Microsoft may freely use,

reproduce, license, distribute, and otherwise commercialize Your Feedback in any Microsoft Offering; (b) You also grant third parties, without

charge, only those patent rights necessary to enable other Products to use or interface with any specific parts of a Microsoft Product that

incorporate Your Feedback; and (c) You will not give Microsoft any Feedback (i) that You have reason to believe is subject to any patent,

copyright or other intellectual property claim or right of any third party; or (ii) subject to license terms which seek to require any Microsoft

Offering incorporating or derived from such Feedback, or other Microsoft intellectual property, to be licensed to or otherwise shared with any

third party.

6. Microsoft has no obligation to maintain confidentiality of any Microsoft Offering, but otherwise the confidentiality of Your Feedback,

including Your identity as the source of such Feedback, is governed by Your NDA.

7. This agreement is governed by the laws of the State of Washington. Any dispute involving it must be brought in the federal or state

superior courts located in King County, Washington, and You waive any defenses allowing the dispute to be litigated elsewhere. If there is

litigation, the losing party must pay the other party’s reasonable attorneys’ fees, costs and other expenses. If any part of this agreement is

unenforceable, it will be considered modified to the extent necessary to make it enforceable, and the remainder shall continue in effect. This

agreement is the entire agreement between You and Microsoft concerning these Materials; it may be changed only by a written document

signed by both You and Microsoft.

Page 3: Sbc Windows 7 Deployment Labs

Contents

Introduction ............................................................................................................................... 1 Deployment Overview ............................................................................................................. 1 Hardware Requirements .......................................................................................................... 1 Optional Software ................................................................................................................... 2 Terminology ........................................................................................................................... 2 Additional Information ............................................................................................................. 3

Lab 1: Prepare your lab environment ............................................................................................ 4 Step 1.1: Install Windows OPK tools .......................................................................................... 4 Step 1.2: Create a distribution share ......................................................................................... 4 Step 1.3: Add drivers and applications to your distribution share .................................................. 5 Step 1.4: Create a bootable Windows PE media .......................................................................... 5

Lab 2.0: Design a Windows 7 installation ....................................................................................... 7 Disk configuration support ....................................................................................................... 7 Step 2.1: Create an answer file ................................................................................................ 7 Step 2.2: Open a distribution share ........................................................................................... 8 Step 2.3: Add and configure Windows settings ........................................................................... 8 Step 2.4: Add OEM customizations ............................................................................................ 9 Step 2.5: Customize Windows Welcome (OOBE) ......................................................................... 11 Step 2.6: Add a device driver to your answer file ........................................................................ 11 Step 2.7: Add an application .................................................................................................... 12 Step 2.8: Validate your answer file ........................................................................................... 12 Step 2.9: Create a configuration set .......................................................................................... 13

Lab 3.0: Build a reference computer ............................................................................................. 14 Why use Sysprep? .................................................................................................................. 14 Why use audit mode? .............................................................................................................. 14 Step 3.1: Build a reference installation ...................................................................................... 14 Step 3.2: Add additional customizations .................................................................................... 15 Step 3.3: Prepare the image by using Sysprep ........................................................................... 15 Step 3.4: Capture an image of the installation ............................................................................ 15

Lab 4.0: Deploy a Windows 7 image ............................................................................................. 16 Step 4.1: Prepare destination computer ..................................................................................... 16 Step 4.2: Apply image to hard drive .......................................................................................... 17 Step 4.3: Shutdown destination computer ................................................................................. 17

Lab 5.0: Test your Windows 7 installation ...................................................................................... 18 OEM Setup Analyzer (OSA.exe) ................................................................................................ 18 Step 5.1: Copy OSA to a removable media ................................................................................ 18 Step 5.2: Run OEM Setup Analyzer against an installation ........................................................... 18

Lab 6.0: Service your Windows 7 image by using DISM ................................................................... 20 Step 6.1: Mount your image ..................................................................................................... 20 Step 6.2: Add a Package .......................................................................................................... 20 Step 6.3: Unmount and commit changes ................................................................................... 21 Optional DISM tasks ................................................................................................................ 21

Enable a feature ................................................................................................................. 21 Apply changes to an offline image by using an answer file ........................................................ 21

Lab 7.0: Build a Windows Recovery environment ............................................................................ 23 Step 7.1: Setup-based recovery solution ................................................................................... 23

Step 7.1.1: Prepare destination computer .............................................................................. 23 Step 7.1.2: Configure recovery partition ................................................................................ 24 Step 7.1.3: Test your recovery solution ................................................................................. 24

Step 7.2 Custom recovery solution ............................................................................................ 25 Step 7.2.1: Extract the Windows RE image ............................................................................. 25

Page 4: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

© 2008 Microsoft Corporation. All rights reserved. Version 1.2

Step 7.2.2: (Optional) Add drivers ........................................................................................ 26 Step 7.2.3: Configure your custom recovery tool .................................................................... 26 Step 7.2.4: Save your customized Windows RE image ............................................................. 26 Step 7.2.5: Prepare destination computer .............................................................................. 27 Step 7.2.6: Configure recovery partition ................................................................................ 27 Step 7.2.7: Test your custom recovery solution ...................................................................... 27

Lab 8.0: Additional customizations (Optional) ................................................................................ 29 Step 8.1: Windows System Assessment Tool (WinSAT) ................................................................ 29

Step 8.1.1 Prepopulate WinSAT data to reduce Windows setup time .......................................... 29 Step 8.2: Enable Windows 7 BitLocker ....................................................................................... 29

Page 5: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

1

Introduction The following labs demonstrates an image-based deployment scenario using the latest Windows® 7 OEM Preinstallation Kit® (OPK) tools. These labs provide a preview of key functions within each technology area of the OPK to ensure a broad understanding of Windows 7 deployment.

Deployment Overview The labs take you through the typical installation lifecycle: setup, design, building, deployment, and servicing. Labs 1 to 6 are the core labs, and labs 7 to 8 are optional. The process for building and deploying a Windows 7 installation is mostly the same as for deploying Windows Vista®. However, several Windows Vista command-line tools have been replaced by one tool called Deployment and Imaging Services Manager (DISM). The following illustration shows the deployment process, from creating an answer file to deploying an image onto a new computer.

Deployment Process Diagram

First, you set up your lab environment by building a technician computer and creating Windows Preinstallation Environment (Windows PE) media. Then you use Windows System Information Manager (Windows SIM) to create an answer file and to build a Windows 7 image. Next, you configure the installation to boot into audit mode, so that you can further customize the image. Then you use the product DVD with your answer file to run Windows Setup and create a reference computer. Next, you generalize and capture an image of the installation on a USB flash drive. Finally, you deploy the image to a destination computer by using the ImageX tool and your Windows PE media.

After the installation is complete, you run through the complete first-boot experience. You then use the OEM Setup Analyzer (OSA) tool to measure first-boot performance and to identify potential performance issues. To understand the impact of various customization options, you can run the tool again to gather additional metrics to compare with previous performances.

Finally, you service your image by using the DISM tool.

Hardware Requirements To complete the labs, you must have the following hardware:

Page 6: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

2

Technician computer with CD or DVD burner

o OS: Vista SP1 or Windows 7

o Processor: 1.5 GHZ or better

o Memory: 2 GB or better

o Video: DirectX 9.0 capable and WDDM 1.0 driver support, 128 MB graphics memory

o Hard disk: At least 20 GB of free space

o DVD reader (DVD writer is necessary if you wish to create Windows PE media)

One or more computers for reference installation

o Processor: 1.5 GHZ or better

o Memory: 2 GB or better

o Video: DirectX 9.0 capable and WDDM 1.0 driver support, 128 MB graphics memory

o HDD: At least 20 GB of free space

o DVD reader

Blank media (DVD or CD)

USB flash drive with 40 GB free space

Optional Software To successfully complete the labs, you must have the following software and source files:

Art Out-of-box experience (OOBE) branding, performance center branding, desktop

images, and so on

Applications OEM welcome application, add-ins, and so on

Hardware drivers Out-of-box drivers for the hard disk, network, video or other hardware

supported on your reference or destination computers

Proprietary recovery application If you have developed your own recovery solution,

you need the source or executable to integrate it in the Windows recovery environment

Terminology Deployment Image Servicing and Management (DISM) Command-line tool that you can use to update a Windows image or a Windows PE image. DISM replaces Package Manager from Windows Vista and improves offline servicing.

ImageX Command-line tool that captures, modifies, and applies installation images for

deployment in a manufacturing environment.

Reference computer Fully-assembled computer containing a reference installation.

Technician computer Computer on which you install Windows System Image Manager

(Windows SIM). Typically, the configuration sets and the distribution share are also on this

computer.

Windows image (.wim) file File format that contains one or more compressed Windows images.

Windows Preinstallation Environment (Windows PE) Minimal Win32 installation

environment that is built on the Windows kernel. You can use Windows PE to prepare a computer for Windows installation, copy disk images from a network file server, and start Windows setup.

Page 7: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

3

Windows System Image Manager (Windows SIM) Utility for creating and modifying unattended answer files and configuration sets.

Windows Welcome A series of pages that takes end users through the steps of adding information that personalizes their settings.

Additional Information

You can find additional information about the steps in these labs in the OPK Help documentation.

To access OPK.chm from your technician computer, click Start, click All Programs, click Microsoft Windows OPK, and then click Documentation.

Page 8: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

4

Lab 1: Prepare your lab environment In this lab, you set up your lab environment by installing the Windows 7 OPK tools on your technician computer. In addition, you build a bootable Windows PE CD. Lab environments can range from a single, non-networked computer to a large, server-based network. In these labs, you simulate a simple network environment. In place of a network, you use a USB flash drive to move files between computers.

Duration

This lab takes approximately 30 minutes.

Prerequisites

Technician computer

Reference computer

Windows 7 OPK media

Blank CD or DVD

USB flash drive with 40 GB free space

Your custom art, drivers, and applications

Step 1.1: Install Windows OPK tools In this step, you install the Windows OPK tools onto your designated technician computer.

Important If you have a previous version of the Windows OPK, you must first uninstall it.

1. On your technician computer, insert your Windows 7 OPK media.

If the OPK setup does not start automatically, you can manually start the installation. In

Windows Explorer, navigate to your Windows 7 OPK media, click the OPK folder, and then

double-click StartCD.exe.

2. Follow the on-screen instructions to complete the installation.

By default, Setup creates the following directory structure:

C:\Program Files\Windows OPK\Docs\

C:\Program Files\Windows OPK\Recovery\

C:\Program Files\Windows OPK\Samples\

C:\Program Files\Windows OPK\SDKs\

C:\Program Files\Windows OPK\Tools\

Step 1.2: Create a distribution share After you have installed the OPK, you manually create a local distribution share that contains all your custom files.

1. On your technician computer, in Windows Explorer, create a new folder for the

distribution share. You can create this folder on a network share or on your computer.

2. Inside this folder, create the following subfolders:

\$OEM$ Folders

\Packages

\Out-of-Box Drivers

Page 9: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

5

3. Copy your packages (.cab, .msu), drivers (.inf), and language packs (lp.cab) into the

appropriate subfolders.

Important Windows SIM recognizes only these subfolder names. You must include at least one of the three folders in your distribution share. The subfolder names must match exactly so that Windows SIM can read the subfolder contents.

Step 1.3: Add drivers and applications to your distribution share

In this step, you add your custom drivers, applications, or resource files.

Note Adding applications in this step does not install them on the reference computer.

This step adds the applications to the configuration set that you install with your

customized image. To install your applications, see Lab 2.0, step 2.8.

An answer file supports three types of driver installation files: .inf, .exe, and .msi. In this step, you

add an out-of-box (.inf) driver to the \Out-of-box drivers folder and an application to the \$OEM$ Folders.

To learn more about distribution shares, see "Understanding Distribution Shares and Configuration Sets" in the OPK Help documentation.

1. Copy your out-of-box driver files (.inf) to C:\MyDistributionShare\Out-of-Box

Drivers\<Driver Folder>. Copy only .inf drivers and their related files. To add multiple

drivers to this directory, create subdirectories for each driver or driver category so there

are no conflicts for drivers with the same file name.

2. Copy your applications to C:\MyDistributionShare\$OEM$

Folders\$1\Program Files\<Application Folder>. To add multiple applications

to this directory, create subdirectories for each application or application category so

there are no conflicts for applications with the same file name.

Step 1.4: Create a bootable Windows PE media In this step, you create bootable Windows PE media by using ImageX. You can use Windows PE RAM to start a computer for deployment and recovery. Windows PE RAM boots directly into memory, so you can remove the Windows PE media after the computer boots. You can use ImageX to capture and apply your Windows 7 image.

1. On your technician computer, click Start, point to All Programs, point to Windows OPK,

right-click Deployment Tools Command Prompt, and then click Run as administrator.

2. At the command prompt, run the Copype.cmd script. The script requires two arguments:

hardware architecture and destination location. In this example, we build an x86 computer.

copype.cmd x86 c:\winpe_x86

The script creates the following directory structure and copies all the necessary files for that architecture:

\winpe_x86

\winpe_x86\ISO

Page 10: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

6

\winpe_x86\mount

3. Copy the base image (Winpe.wim) to the \Winpe_x86\ISO\sources folder and rename the file to

Boot.wim.

copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

4. Mount the Windows PE image by using ImageX, and then add the ImageX tool to your Windows

PE image:

imagex /mountrw c:\winpe_x86\ISO\sources\boot.wim 1 c:\winpe_x86\mount

copy "c:\program files\Windows OPK\Tools\<architecture>\imagex.exe"

c:\winpe_x86\mount\Windows\System32

5. Commit your changes by using the ImageX /unmount /commit option:

Imagex /unmount c:\winpe_x86\mount /commit

6. Create an .iso file. You can use a non-Microsoft tool or the Oscdimg tool provided:

oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO

c:\winpe_x86\winpe_x86.iso

7. Burn the .iso file to media. You can use a non-Microsoft tool or follow these directions from a

Windows 7 environment:

a. Click Start, in the Search programs and files box, type c:\winpe_x86, and then

select winpe_x86 from the list.

b. Right-click winpe_x86.iso, and then select Burn Disc Image.

c. Insert a blank CD or DVD.

d. Select the appropriate drive letter.

e. Click Burn.

Page 11: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

7

Lab 2.0: Design a Windows 7 installation In this lab, you design a custom Windows 7 installation by using Windows SIM. You can include several customizations and custom applications in the installation. The installation boots into audit mode, so you can further customize your installation. In this lab, you use Windows SIM, an answer file, and Oobe.xml. The following screen shot illustrates the Windows SIM user interface.

Windows SIM User Interface

Duration

This lab takes approximately 1 to 2 hours.

Prerequisites

Technician computer

USB flash drive

Your custom drivers, art, and applications

Disk configuration support Windows Setup supports creating multiple partition types. By default, Windows Retail Setup creates two partitions: a system partition and an operating-system partition. This configuration provides support for Windows BitLocker™ Drive Encryption as well as for other performance benefits of Windows 7. For this lab, you build a single-partition installation and later deploy the image onto a two-partition configuration (three partitions if you include Windows Recovery).

Step 2.1: Create an answer file In this step, you create a new answer file. A catalog file (.clg) is a binary file that contains the state of all the settings and the packages in a Windows image.

1. On your technician computer, click Start, point to All Programs, point to Microsoft

Windows OPK, and then click Windows System Image Manager.

Page 12: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

8

2. On the File menu, click Select Windows Image.

3. In the Select a Windows Image dialog box, select a catalog file (.clg) that

corresponds to the Windows version you want build, and then click Open.

Windows 7 catalog files are available from your Windows 7 media, in the \sources folder.

4. On the File menu, click New Answer File.

Step 2.2: Open a distribution share In Lab 1.0, you created a sample distribution share on your local hard drive or on your network.

1. In Windows SIM, click Select a Distribution Share.

2. Browse to the distribution share you created earlier.

3. Click Open.

Step 2.3: Add and configure Windows settings In this step, you define the basic disk configuration.

1. In the Windows Image pane, expand the Components node to display available

settings.

2. On the expanded list of components, add the following components to your answer file by

right-clicking the component and then selecting the appropriate configuration pass:

Component Configuration Pass

Microsoft-Windows-Deployment\Reseal oobeSystem

Microsoft-Windows-International-Core-WinPE windowsPE

Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\ CreatePartition windowsPE

Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ ModifyPartition windowsPE

Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo windowsPE

Microsoft-Windows-Setup \UserData windowsPE

3. The settings that you added appear in the Answer File pane. Select and configure each

setting as specified below:

Component Value

Microsoft-Windows-International-Core-WinPE InputLocale = en-US

SystemLocale = en-US

UILanguage = en-US

UserLocale = en-US

Page 13: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

9

Microsoft-Windows-International-Core-WinPE\SetupUILanguage UILanguage = en-US

Microsoft-Windows-Setup UseConfigurationSet = true

Microsoft-Windows-Setup\DiskConfiguration WillShowUI = OnError

Microsoft-Windows-Setup\DiskConfiguration\Disk DiskID = 0

WillWipeDisk = true

Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition

Extend = true

Order = 1

Type = Primary

Microsoft-Windows-Setup

\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition

Active = true

Format = NTFS

Label = WIN7_OS

Letter = C

Order = 1

PartitionID = 1

Microsoft-Windows-Setup\ImageInstall\OSImage\ WillShowUI = OnError

Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo DiskID = 0

PartitionID = 1

Microsoft-Windows-Setup \UserData AcceptEula = true

Microsoft-Windows-Setup \UserData\ProductKey Key = <enter 25-digit product key>

WillShowUI = OnError

Microsoft-Windows-Deployment\Reseal ForceShutdownNow = false

Mode = Audit

Step 2.4: Add OEM customizations In this step, you customize your image to take advantage of differentiation, performance, and money-making opportunities. To customize the image, you add additional unattended settings to your answer file.

In addition, you must create a custom content file called Oobe.xml by using Notepad or a similar text editor. A sample oobe.xml is included with your Windows OPK installation under Program Files\Windows OPK\Samples\OOBE\info.

In addition to what you set in oobe.xml, you can customize the following components:

System properties (Shell-Setup component)

Performance information and tools (PerfCenterCPL component)

Internet Explorer (IE_InternetExplorer component)

Desktop background (Shell-Setup component)

Page 14: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

10

1. In the Windows Image pane of Windows SIM, expand the Components node to

display available settings.

2. On the expanded list of components, add the following components to your answer file by

right-clicking the component and then selecting the appropriate configuration pass.

Component Configuration Pass

Microsoft-Windows-IE-InternetExplorer\FavoritesList\FavoriteItem specialize

Microsoft-Windows-IE-InternetExplorer\SearchScopes\Scope specialize

Microsoft-Windows-IE-InternetExplorer\StartPages\StartPage specialize

Microsoft-Windows-IE-InternetExplorer\StartPages\StartPage specialize

Microsoft-Windows-PerfCenterCPL\WindowsExperienceIndexOemInfo oobeSystem

Microsoft-Windows-Shell-Setup\OEMInformation specialize

3. The settings that you added appear in the Answer File pane. Select and configure each

setting as specified below.

Component Value

Microsoft-Windows-IE-InternetExplorer\FavoritesList\FavoriteItem

FavID = Favorite1

FavTitle = Fabrikam

FavURL = http://www.fabrikam.com

Microsoft-Windows-IE-InternetExplorer\SearchScopes\Scope

ScopeDisplayName = Wikipedia

ScopeKey = Scope1

ScopeURL = http://en.wikipedia.org/wiki/Special:Search?search={searchTerms}

Microsoft-Windows-IE-InternetExplorer\StartPages\StartPage

StartPageKey = Home page 1

StartPageURL = http://www.fabrikam.com

Microsoft-Windows-IE-InternetExplorer\StartPages\StartPage

StartPageKey = Home page 2

StartPageURL = http://www.contoso.com

Microsoft-Windows-Shell-Setup \OEMInformation

HelpCustomized = false

Logo = <PathtoYour100x100_96dpi.bmpFile>

Manufacturer = <CompanyName>

SupportHours = <SupportHours>

SupportPhone = <SupportNumber>

SupportURL = <SupportURL>

Microsoft-Windows-PerfCenterCPL\WindowsExperienceIndexOemInfo

HardwareUpgradeURL = <SupportURL>

Logo = <PathtoYour48x48_96dpi.bmpFile>

Page 15: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

11

Step 2.5: Customize Windows Welcome (OOBE) In this step, you customize Windows Welcome, the out-of-box experience for Windows 7, by creating a custom content file called Oobe.xml. You can use Oobe.xml to define text, images, and settings during Windows Welcome. You can also use Oobe.xml to define images for the first user tile and for the desktop background.

1. Using a text editor, like Notepad, create a file called Oobe.xml. Enter the following

text:

<?xml version="1.0" encoding="utf-8" ?> <FirstExperience> <oobe> <oem> <name>Fabrikam</name>

<logopath>c:\Windows\System32\OOBE\Info\<your 240x120.png file></logopath>

<eulafilename>fabrikam_eula.rtf</eulafilename> <OutOfBoxBackground>true</OutOfBoxBackground>

<usertilepath> c:\Windows\System32\OOBE\Info\<your 128x128 .bmp file></usertilepath>

<computername>FAB01</computername> </oem> <defaults> <language>1033</language> <location>39</location> <locale>16393</locale> <keyboard>00000409</keyboard> <timezone>Hawaiian Standard Time</timezone> <adjustForDST>false</adjustForDST> <hideRegionalSettings>true</hideRegionalSettings> <hideTimeAndDate>true</hideTimeAndDate> </defaults> </oobe> </FirstExperience>

Note A sample Oobe.xml file is located at c:\Program Files\Windows

OPK\Samples\OOBE\Info\Oobe.xml.

2. Save your Oobe.xml file and any supporting art files (.png, .bmp) to

c:\MyDistributionShare\$OEM$ Folders\$1\Windows\System32\OOBE\info.

For more information on other OEM customizations, see "Value Areas for OEMs" in the OPK.chm.

Step 2.6: Add a device driver to your answer file

In this step, you can add paths for boot-critical and other .inf drivers to your answer file.

Note To install complex drivers, you can manually add drivers on your reference computer when you boot into audit mode. For information about audit mode, see the "Customize Windows in Audit Mode" topic in the OPK Help documentation.

To add boot-critical driver paths to your answer file

1. On the Insert menu, point to Driver Path, and then click Pass 1 windowsPE.

2. Select the path to your driver, and then click OK.

c:\MyDistributionShare\Out-of-Box Drivers\Driver1

Page 16: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

12

To add other driver paths to your answer file

1. On the Insert menu, click Driver Path, and then click Pass 5 auditSystem.

2. Select the path to your driver and then click OK.

c:\MyDistributionShare\TBD\Driver1

You can add only .inf files to the driver store during installation. To run an .exe or .msi driver package, you must add a custom command to install the driver package. For more information, see the "Add a Custom Command to an Answer File" topic in the OPK Help documentation.

Step 2.7: Add an application

In this step, you can add an application or an executable driver to your installation. You must first

add the source files to your distribution share and then reference the source files in your answer

file.

1. Create an application folder in your distribution share under

c:\MyDistributionShare\$OEM$ Folders\$1\Program

Files\<ApplicationFolder>:

MD "c:\MyDistributionShare\$OEM$ Folders\$1\Program Files\MyApplication"

2. Copy your application sources into the application folder:

copy c:\myapp.exe "c:\MyDistributionShare\$OEM$ Folders\$1\Program

Files\MyApplication"

3. If your application requires installation, add a synchronous command to run the setup

program.

a. On the Insert menu, point to Synchronous Command, and then click Pass 6

auditUser.

b. In the Enter command line text box, enter the command to install the application

that you placed in $OEM$ Folders. By default, the source files you copied into

\$OEM$ Folders\$1\ Program Files folder are automatically copied into c:\Program

Files\ folder on the reference computer.

c:\Program Files\MyApplication\myapp.exe

4. If you have more than one command to run, enter a number in the Order field to specify

what order to run the commands in.

5. Click OK.

Step 2.8: Validate your answer file In this step, you validate the settings and save your answer file.

Page 17: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

13

1. In Windows SIM, click Tools, and then click Validate Answer File.

If the answer file validates successfully, the Messages pane displays "No warnings or errors." Otherwise, error messages appear in the same location.

Note If a warning occurs, you can skip the warning or double-click on the warning entry for more details. When adding drivers, Windows SIM automatically adds a credentials entry for each driver you add. The credentials entry is initially blank and causes a warning.

2. If an error occurs, double-click the error in the Messages pane to navigate to the

incorrect setting. Change the setting to fix the error, and then validate the file again.

3. On the File menu, click Save Answer File. Save as Lab2_AnswerFile.xml.

Step 2.9: Create a configuration set In this step, you create a configuration set that gathers all the resource files that you specified in your answer file.

1. On the Tools menu, select Create Configuration Set.

2. In the Create Configuration Set text box, specify the root directory of your USB flash

drive as your target location.

Important You must store your answer file (autounattend.xml) and all supporting files at

the root directory, so Windows Setup can find it. Your configuration set must be stored on a

removable device for Windows Setup to detect.

3. Select the location of the $OEM$ Folders you created in your distribution share, and

then click OK.

Windows SIM creates the following configuration set structure on your USB flash drive.

\$OEM$\ - contains all source files \AutoUnattend_Files\ - contains Windows packages AutoUnattend.xml – your answer file

For More Information

For detailed documentation on the tools and processes outlined in this lab, see "Phase 3: Preparing and Customizing Your Windows Image" in the OPK Help documentation. For more information on other unattended-installation settings, see Unattended Windows Setup Reference (unattend.chm).

Page 18: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

14

Lab 3.0: Build a reference computer In this lab, you build a reference computer with the Windows 7 Product DVD and the configuration set you created in Lab 2. After Windows Setup installs your image, the reference computer reboots into audit mode. In audit mode, you can add additional customizations. The key tools you use in this lab are Windows Setup, Sysprep, Windows PE, and ImageX.

Duration

This lab takes approximately 1 to 2 hours.

Prerequisites

Windows 7 Product DVD

Reference computer

USB flash drive

Windows PE bootable media with ImageX

Why use Sysprep? You are required to reseal the new installation by using the System Preparation (Sysprep) tool. The Sysprep tool removes system-specific information and resets the computer, so that the next time the computer starts, the end user can accept the Microsoft Software License Terms and add user-specific information.

Why use audit mode? There are two modes that Windows can boot to during an unattended installation: audit mode and Windows Welcome. In audit mode, you can install additional applications and device drivers, run scripts, or apply updates to your Windows installation. After you complete your configurations in audit mode, you can set the computer to boot to Windows Welcome on next boot by using Sysprep. You can also use audit mode to install pending applications, such as language packs.

Step 3.1: Build a reference installation In this step, you build a reference installation by using the Windows 7 Product DVD and your configuration set, which contains your answer file.

1. Connect the USB flash drive that contains your answer file and configuration set to the

reference computer.

2. Insert your Windows 7 Product DVD and boot the reference computer.

Important You may need to set the boot order to boot from DVD. If Windows Setup does

not detect your USB flash drive in time, Setup automatically boots to Windows Welcome. If

this happens, you can boot your computer with Windows PE and manually run

Windows Setup with the /unattend option.

3. Check that all your customizations were applied.

Note Some OEM customization, such as Windows Welcome customizations, do not appear

during audit mode.

Page 19: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

15

Step 3.2: Add additional customizations In this step, you can add additional customizations while in audit mode. Depending on the complexity of your system, audit mode may be the most efficient method for adding customizations.

Step 3.3: Prepare the image by using Sysprep In this step, you generalize your image by running the Sysprep tool. While in audit mode, the System Preparation Tool dialog box starts when you boot the computer.

1. In the System Preparation Tool dialog box, point to System Cleanup Action, and then

click Enter System Out-of-Box Experience (OOBE).

2. Select the Generalize checkbox.

3. Point to Shutdown Options, and then click Shutdown.

4. Click OK.

Step 3.4: Capture an image of the installation In this step, you capture an image of your installation and store it onto your USB flash drive. You use this image throughout the remaining labs.

1. Boot the reference computer by using your bootable Windows PE media with ImageX. When

prompted, press any key to boot into Windows PE.

Important You may need to set the boot order to boot from DVD. If the system does not boot into Windows PE and Windows Welcome starts, the image is not longer valid for the remaining labs. You must repeat lab 3.0.

2. From the Windows PE command prompt, type the following to create a \images folder on

the root directory of your USB flash drive, where E is the letter of your USB flash drive:

md e:\images

3. To capture an image of the installation and save it to your USB flash drive, type the

following:

imagex /capture c: e:\images\myWin7.wim "Windows 7"

4. After ImageX captures your image, shut down the computer. From the Windows PE

command prompt, type the following:

wpeutil shutdown

Page 20: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

16

Lab 4.0: Deploy a Windows 7 image

In this lab, you deploy your custom Windows 7 image to a destination computer by using ImageX

and Windows PE. On the destination computer, you format the hard drive and create two

partitions, apply the Windows 7 image to the second partition, and then run BCDBoot to

reconfigure the boot configuration data (BCD) store. The key tools you use in this lab are Windows PE, ImageX, DISM, Diskpart, and BCDBoot.

Duration

This lab takes approximately 2 hours.

Prerequisites

Windows 7 image from Lab 3.0 stored on a USB hard drive

Destination computer

Windows PE bootable media with ImageX

Step 4.1: Prepare destination computer In this step, you boot your destination computer and prepare the hard drive by using Windows PE and Diskpart.

Note If you do not have a designated destination computer, you can reuse your reference computer.

1. On your destination computer, insert your Windows PE media and restart the computer.

Windows PE starts and launches a Command Prompt window.

Note You may need to override the boot order to boot from the CD/DVD-ROM drive. During initial boot, select the appropriate function key to override the boot order.

2. At the command prompt, use Diskpart to format the hard drive to the appropriate disk

configuration.

Note You can save the following text to a text file in the same location as your image. To

run the script from a Windows PE Command Prompt window, type diskpart /s

scriptname.txt.

diskpart

select disk 0

clean

create partition primary size=500

select partition 1

active

format fs=ntfs label="System" quick

assign letter = s

create partition primary

select partition 2

format fs=ntfs label="WINDOWS" quick

assign letter = c

exit

Page 21: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

17

Step 4.2: Apply image to hard drive In this step, you apply your custom Windows 7 image to the hard disk. Next, you run the BCDBoot tool to configure the boot partition.

1. Connect your USB flash drive that contains your custom Windows 7 image.

2. From the command prompt, apply the image to the hard drive by using ImageX:

D:\imagex.exe /apply e:\images\myWin7.wim 1 c:

3. Type the following to run BCDBoot to update the BCD store:

c:\Windows\system32\bcdboot.exe c:\windows

Step 4.3: Shutdown destination computer This completes the deployment of your custom Windows 7 image. Shutdown the destination computer and deliver the system to your customer.

From the Windows PE command prompt, type the following:

Wpeutil shutdown

Page 22: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

18

Lab 5.0: Test your Windows 7 installation In this lab, you test your newly deployed image from Lab 4. Like your customers, you start the computer and walk through the first-boot experience. During this process, you can verify that your customizations appear correctly.

When you reach the desktop, you analyze the first-boot time by using OEM Setup Analyzer (OSA). The tool gathers statistics related to first boot by using existing log files. For comparison, you can run the tool on a variety of installations.

Duration

This lab takes approximately 5 minutes per test.

Prerequisites

USB flash drive

Destination computer with your Windows 7 installation

OEM Setup Analyzer (OSA.exe) OEM Setup Analyzer is a new tool for Windows 7. You can use this tool to understand various elements of the first-boot experience and to reduce overall boot time. You can run the tool from any writeable media. The tool scans the computer log files and gathers specific data related to first boot. The toolset consist of the following directory structure:

\config \\contains scenario and schema information used to translate log files

\dataset \\contains raw data related to computer scan

\lib \\contains internal tool resources

\logs \\contains logs for each time the tool runs

\reports \\contains generated reports

Common.dll

OSA.exe

Step 5.1: Copy OSA to a removable media To run the tool, you must first copy the sources to a removable, writable media, such as a USB flash drive.

From your technician computer, copy the c:\Program Files\Windows

OPK\Tools\OSA\X86\ folder to your removable media.

Step 5.2: Run OEM Setup Analyzer against an installation

1. Turn on the destination computer with your Windows 7 installation.

2. For new installations, complete the Windows Welcome to reach the desktop.

3. When first boot is complete, connect the removable media that contains the OSA tool to the

computer.

4. Run OEM Setup Analyzer (osa.exe).

5. At the command prompt, type Y to provide a custom report name and then press Enter.

Page 23: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

19

6. Type a custom name and then press Enter.

The tool scans the computer for event logs, creates a dataset, and then displays an HTML-

based report.

For More Information

For more information on OSA, see OEM Setup Analyzer Command-Line Tool in the OPK Help documentation.

Page 24: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

20

Lab 6.0: Service your Windows 7 image by using DISM In this lab, you update your Windows 7 image by using Deployment Image Servicing and Management (DISM). DISM is a new command line tool for Windows 7 that installs, uninstalls, configures, and updates features and packages. DISM combines the functionality of several Windows Vista OPK tools, including PEIMG, Intlcfg, and Package Manager. DISM supports updating both an offline image (.wim) and a subset of functions online. DISM is available in Windows 7 and Windows PE for Windows 7.

DISM provides all the same functionality of Windows Vista Package Manager, as well as the following:

Adding, removing, and enumerating packages and drivers

Enabling, disabling, and enumerating Windows features

Appling changes based on the offlineServicing section of an unattend.xml answer file

Configuring international settings

Updating a Windows image to a different edition

Updating a Windows PE image

Enumerating applications and patches in an offline image

Servicing previous operating systems like Windows Vista and Windows Server® 2008.

Runs on more platforms (32-bit, 64-bit and Itanium)

Duration

This lab takes approximately 30 minutes.

Prerequisites

Technician computer

USB flash drive containing your preinstalled, generalized image of Windows 7, as described

in Lab 3.0

Step 6.1: Mount your image In this step, you mount your Windows image by using DISM. You can use DISM to mount and unmount images to service offline.

At the command prompt, type the following:

MD c:\Service\Mount

DISM /Mount-Wim /WimFile:e:\images\myWin7.wim /index:1

/Mountdir:c:\Service\Mount

Step 6.2: Add a Package In this step, you add a package (.cab or .msu) to your offline Windows 7 image.

1. Type the following to add a package by using the DISM /Add-Package command:

DISM /image:c:\Service\Mount /Add-Package

/PackagePath:c:\MyDistributionShare\Packages\<.cab_or_.msuPackageType>

Page 25: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

21

2. Use the DISM /Get-Packages command to verify that the package was added to the

image. This command shows the corresponding .cab packages instead of .msu packages.

DISM /image:c:\Service\Mount /Get-packages

Step 6.3: Unmount and commit changes In this step, you unmount and commit your changes to the image.

At the command prompt, type the following:

DISM /unmount-wim /Mountdir:c:\Service\Mount /commit

Optional DISM tasks

Enable a feature

In this step, you enable a Windows feature offline on your existing Windows 7 image.

1. From an elevated command prompt, mount the image to a directory:

DISM /Mount-WIM/WimFile:e:\images\MyWin7_Lab6a.wim /Index:1 /mountdir:c:\Service\Mount

2. Use the DISM /Get-Features command to find the feature you want to enable.

a. If you know the name of the feature, use the featurename command to find the

feature:

DISM /image:<path_to_image> /get-featureinfo /featurename:<name_in_image>

DISM /image:<path_to_image> /get-features /packagepath:<path_to_file.cab>

b. To get a list of all the features, use this command:

DISM /image:<path_to_image> /get-features

3. Enable the feature by using the DISM /Enable-Feature command:

DISM /image:c:\Service\Mount /enable-feature /FeatureName:< name_in_image >

4. Verify that the feature was enabled by using DISM /Get-FeatureInfo:

DISM /image:c:\Service\Mount /get-featureInfo /featurename:<name_in_image>

3. Unmount and commit the changes:

DISM /unmount-WIM /MountDir:c:\Service\Mount /Commit

Apply changes to an offline image by using an answer file

Like Package Manager, DISM can use an answer file created by Windows SIM. You can use this feature to define and apply several packages and drivers at the same time. This method is faster than manually scripting each modification.

Page 26: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

22

1. Connect your USB flash drive that contains your Windows 7 image (.wim) to your technician

computer.

2. Make a backup copy of your Windows 7 image by using the following command:

copy e:\images\MyWin7.wim e:\images\MyWin7_Lab6b.wim

3. Mount the copied Windows 7 image:

DISM /Mount-Wim /WimFile:e:\images\MyWin7_Lab6b.wim /Index:1 /MountDir:c:\Service\Mount

4. Apply the answer file to the offline image:

DISM /image:c:\Service\Mount /Apply-Unattend:<path_to_file>

5. Use /Get commands to verify packages and drivers were installed.

DISM /image:c:\Service\Mount /Get-Drivers

6. Unmount the image and commit the changes.

DISM /unmount-WIM /MountDir:c:\Service\Mount /Commit

Page 27: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

23

Lab 7.0: Build a Windows Recovery environment Windows 7 supports two recovery solutions: Setup-based and Custom. This lab describes both options.

Step 7.1: Setup-based recovery solution In this step, you build a setup-based recovery solution. First, you boot your destination computer and prepare the hard drive using Windows PE and Diskpart. Next, you format the hard drive into three partitions by using Diskpart. Then, you apply your Windows image to the OS partition and a copy of the image to the recovery partition.

Duration

This lab takes approximately 60 minutes.

Prerequisites

USB flash drive containing your Windows 7 image

Destination computer

Windows PE bootable media with ImageX

Step 7.1.1: Prepare destination computer

In this step, you boot your destination computer and prepare the hard drive by using Windows PE and Diskpart. You format the hard drive into three partitions by using Diskpart.

1. On your destination computer, insert your Windows PE media and restart the computer.

Windows PE starts and launches a Command Prompt window.

Note You may need to override the BIOS boot order to boot from the CD/DVD-ROM drive. During initial boot, select the appropriate function key to override the boot order.

2. Format the hard drive to reflect your custom disk configuration by using DiskPart. You can

adjust the size of partition 2 as appropriate, but you must adjust the size of the recovery

partition to reflect the size of your Windows 7 image and Windows RE image.

Note You can save the following text to a text file in the same location as your image. To

run the script from a Windows PE Command Prompt window, type diskpart /s

scriptname.txt:

diskpart

select disk 0

clean

create partition primary size=300 id=27

active

format fs=ntfs label="System" quick

assign letter = s

create partition primary size=3000 id=27

format fs=ntfs label="Recovery" quick

assign letter = r

create partition primary

format fs=ntfs label="Windows" quick

Page 28: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

24

assign letter = c

exit

3. Connect the USB flash drive that contains your custom Windows 7 image and then apply the

image to the hard drive by using ImageX:

D:\imagex.exe /apply e:\images\myWin7.wim 1 c:

4. Run BCDBoot to update the BCD store:

c:\Windows\system32\bcdboot.exe c:\windows

The BCDboot tool configures partition 1 as the system partition by copying boot-specific files

to this partition

Step 7.1.2: Configure recovery partition

In this step, you configure a setup-based recovery partition by using the same Windows 7 image you deployed and the default Windows RE image contained in the Windows partition.

1. Move the default Windows Recovery image (Winre.wim) from the Operating System

partition to the System partition (s:).

Mkdir r:\Recovery\WindowsRE

Move c:\Windows\System32\Recovery\winre.wim s:\Recovery\WindowsRE\

2. Configure Windows to recognize the default Windows Recovery image (Winre.wim):

c:\Windows\System32\Reagentc.exe /setreimage /path s:\Recovery\WindowsRE

/target c:\Windows

3. Copy your Windows 7 image (.wim) to the recovery partition (r:) and rename it to

install.wim:

Copy e:\images\myWin7.wim r:\Recovery\WindowsRE\install.wim

4. Configure Windows RE to recognize your Windows 7 image (.wim) file.

c:\Windows\System32\Reagentc.exe /setosimage /path r: /target c:\Windows

Step 7.1.3: Test your recovery solution

In this step, you start the destination computer to complete the installation and then verify

that the recovery tool starts correctly.

1. Remove the CD and USB flash drive from your computer.

2. Start your destination computer and complete Windows Welcome.

3. From the Start menu, click Control Panel, click All Control Panel Items, and then click

Recovery.

4. Click Advanced recovery methods, and then click Reinstall Windows.

5. Click Return Windows to original settings.

6. Follow the on-screen instructions. The computer restarts.

7. Verify that the computer starts in Windows RE. The system reinstalls Windows by using the

image that you placed in the recovery partition. When the installation is complete, you can

restore backup files.

Page 29: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

25

Step 7.2 Custom recovery solution You can also use Windows Recovery to launch your custom recovery tool from the Windows RE menu, from the Recovery control panel item, or by using your custom hardware key. To do this, you must customize the default Windows RE image (winre.wim) inside the Windows image (install.wim).

Duration

This lab takes approximately 60 minutes.

Prerequisites

Technician computer

USB flash drive

Custom recovery application

USB flash drive containing your Windows 7 image

Destination computer

Windows PE bootable media with ImageX

Step 7.2.1: Extract the Windows RE image

In this step, you mount a Windows 7 image using ImageX. Next, you extract the Windows RE image.

1. On your technician computer, click Start, point to All Programs, point to Microsoft

Windows OPK, and then click Deployment Tools Command Prompt.

2. At the command prompt, create the following directory structure to store the Windows 7

image and its mount point:

\OS_image

\OS_image\mount

3. Create the following directory structure to store the Windows RE image and its mount point:

\winre

\winre\mount

4. Copy the Windows 7 image from the Product DVD to the technician computer:

Copy D:\sources\install.wim c:\OS_image

5. Use the ImageX /mountrw option to mount the Windows 7 image on the Windows 7

Product DVD:

ImageX /mountrw c:\OS_image\install.wim 1 c:\OS_image\mount

6. Copy the Windows RE image from the mounted Windows 7 image:

copy c:\OS_image\mount\windows\system32\recovery\winre.wim c:\winre

7. Use the ImageX /unmount option to unmount the Windows 7 image:

ImageX /unmount c:\OS_image\mount

Page 30: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

26

8. Mount the copy of the Windows RE image for editing:

ImageX /mountrw c:\winre\winre.wim 1 c:\winre\mount

Step 7.2.2: (Optional) Add drivers

You can include other drivers (.inf files) in your Windows RE image by using the DISM.exe /Add-Driver command. In the following example, replace <path to driver.inf> with the location of your driver:

DISM /image=c:\winre\mount /Add-Driver /Driver:<path to driver.inf>

Step 7.2.3: Configure your custom recovery tool

In this step, you add your custom recovery solution to your Windows RE image. To add your solution to the default Windows RE menu, you must create a WinREConfig.xml file that defines the location of your application.

1. If you do not already have a \Tools directory in the mounted Windows RE image, create

one by typing the following:

mkdir c:\winre\mount\sources\recovery\Tools

2. Copy all binaries required by your custom recovery solution to the \Tools directory. For

example:

Copy c:\MyRecoveryApp.exe c:\winre\mount\sources\recovery\Tools

3. Launch Notepad.exe and type the following:

<Recovery>

<FactoryRecoveryTool>

<RelativeFilePath>MyRecoveryApp.exe</RelativeFilePath>

</FactoryRecoveryTool>

</Recovery>

4. Save the text file as winreconfig.xml under the \Tools folder of the mounted Windows RE

image.

For more information on customizing Windows RE and winreconfig.xml, see "Customizing the Windows RE Experience" in the OPK Help documentation.

Step 7.2.4: Save your customized Windows RE image

In this step, you capture all your customizations in the Windows RE image file and save it to your USB flash drive.

1. Commit your customizations and unmount the image by using ImageX:

ImageX.exe /unmount /commit c:\winre\mount

2. Save your custom Windows RE image to your USB flash drive.

Page 31: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

27

Step 7.2.5: Prepare destination computer

Follow the steps outlined in Step 7.1.1.

Step 7.2.6: Configure recovery partition

In this step, you configure your custom recovery solution and the default Windows RE image contained in the Windows partition.

1. Create a Windows RE folder on your recovery partition:

mkdir r:\Recovery\WindowsRE

2. Copy the updated Windows RE image (winre.wim) from your USB flash drive:

Copy e:\winre.wim r:\Recovery\WindowsRE\

Note: Because of the increased size of your winre.wim, the winre.wim is placed on the

recovery partition (r:) instead of the system partition (s:). You can place winre.wim on any

partition with sufficient space.

3. Configure the path to the new location of your Windows RE image by using the reagentc.exe

tool. In addition, specify that when the user presses the F1 button (scan code = 0x3b00)

during startup, Windows RE and the custom factory recovery application launch:

c:\Windows\System32\Reagentc.exe /setreimage /path c:\Recovery\WindowsRE

/target c:\Windows /bootkey 3b00

4. Configure the path from the operating system and your recovery image by using the

reagentc.exe tool:

c:\Windows\System32\Reagentc.exe /setosimage /customtool /target c:\Windows

Step 7.2.7: Test your custom recovery solution

In this step, you start the destination computer to complete the installation and then verify

that the custom recovery solution starts correctly.

1. Verify that your custom factory recovery application starts from the Recovery control panel item in Windows.

a. Start your destination computer and complete Windows Welcome.

b. From the Start menu, click Control Panel. In the Search Control Panel field, type Recovery.

c. From the search results, click Recovery.

d. Click Advanced recovery methods.

e. Click Return Windows to original settings.

f. Follow the instructions in the recovery wizard.

The computer restarts.

g. Verify that the computer starts in Windows RE and that your custom factory recovery

application launches automatically.

2. Verify that your custom recovery application launches from the Windows RE menu.

a. Restart the computer.

b. Immediately after POST, hold down the F8 key.

Page 32: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

28

c. Select Repair your computer on the Advanced Boot Options menu and then press Enter.

d. Follow the on-screen instructions to select a keyboard layout and provide credentials.

e. Verify that a link to your custom factory recovery application appears on the Windows RE

menu.

3. Verify that your custom recovery application launches when you press the F1 key:

a. Restart the computer.

b. Immediately after POST, hold down the F1 key.

c. Verify that your custom recovery application launches automatically.

Page 33: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

29

Lab 8.0: Additional customizations (Optional) This lab contains additional customizations that you can make to your base image.

Prerequisites

Technician machine

Preinstalled image (.wim) of Windows 7 from Lab 2.0

Step 8.1: Windows System Assessment Tool (WinSAT) You can use the Windows System Assessment Tool (WinSAT) to test and analyze the performance of several system components, including CPU, memory, disk, and graphics. The WinSAT results are summarized in the Performance Information and Tools Control Panel item as Windows Experience Index scores. These scores show consumers the performance characteristics of their systems.

Windows 7 has a strong focus on reducing the duration of the first experience for end users, so that they can begin using their computers as soon as possible. To speed up the experience, you can run WinSAT before Windows 7 setup. The only WinSAT assessment that you must prepopulate or run during setup is the desktop window manager (DWM)/Aero test. This test determines whether the desktop window manager can enable the Aero user interface, desktop composition, and related features.

Step 8.1.1 Prepopulate WinSAT data to reduce Windows setup time

In this step you run the WinSat tool in audit mode and then capture your image.

1. Repeat step 3.1 to boot your reference computer into audit mode.

2. From the Start menu, click Run, and then type WinSAT prepop.

This generates the WinSAT prepop.xml results and stores them in the WinSat Datastore (%windir%\performance\winsat\datastore\).

3. Following step 3.3 and step 3.4 to generalize and capture your new Windows image.

4. Repeat Lab 4 to deploy your updated image.

5. Repeat Lab 5 to see specific performance improvements.

Note Do not use prepopulation to transfer WinSAT data on systems with different capabilities, for example laptops and desktops, because the data will not be accurate. You can prepopulate WinSAT data to reuse the data on similar systems, for example systems that contain the same motherboard and chipset and similar CPU, video cards, and disks.

For more information on WinSAT, see "Configure Windows System Assessment Tool Scores" in the OPK Help documentation.

Step 8.2: Enable Windows 7 BitLocker In this step, you enable Windows 7 BitLocker. BitLocker requires two partitions: system and Windows. Unlike Windows Vista, Windows 7 Retail Setup automatically creates these two partitions, making it easier to implement BitLocker. In previous labs, you manually created the two partitions to reflect this requirement. The next step is to enable BitLocker, which encrypts the Windows

Page 34: Sbc Windows 7 Deployment Labs

Windows 7 Deployment Labs

Microsoft Confidential. © 2009 Microsoft Corporation. All rights reserved.

By using or providing feedback on these materials, you agree to the attached license agreement.

30

partition and generates the necessary keys. Typically, the end user enables BitLocker, but you can enable the option to verify the installation.

To enable BitLocker from a Windows 7 computer, you can use one of these methods:

Click the Start button, click Computer, right-click on the OS partition, and then click Turn on BitLocker.

-or-

At the command prompt, type the following to run Manage-bde.exe:

Manage-bde -on c: -rp -TPMAndPin 1234 –SkipHardwareTest