You can deploy Windows 7 installations or upgrades
through a Windows 7 distribution DVD or through a distribution server
that contains Windows 7 images and associated files, such as
Unattend.xml for unattended installations. Using a DVD can be
advantageous if the computer on which you want to install Windows 7 is
not connected to the network or is connected via a low-bandwidth
network. It is also typically faster to install a Windows 7 image from
DVD than to use a network connection.
Unattended installations
rely on options configured in an answer file that is deployed with the
Windows 7 image. Answer files are XML files that contain the settings
that are typically supplied by the installer during attended
installations of Windows 7. Answer files can also contain instructions
for how programs and applications should be run.
The Windows Setup program is
run to install or upgrade to Windows 7 from computers that are running
compatible versions of Windows.
The Windows Setup program
(Setup.exe) replacesWinnt32.exe andWinnt.exe, which are the setup
programs used in versions of Windows prior to Windows Vista. Although
it's a graphical tool, Windows Setup can be run from the command line.
For example, you can use the following command to initiate an unattended
installation of Windows 7:
setup.exe /unattendianswerfile
The Windows Setup program has several command-line options that can be applied. Table 1 describes the Setup.exe command-line options.
Table 1. Setup. exe command-line options and descriptions
Setup.exe Option | Description |
---|
/1394debug: channel [baudrate:baudrate] | Enables
kernel debugging over a FireWire (IEEE 1394) port for troubleshooting
purposes. The [baudrate] optional parameter specifies the baud rate for
data transfer during the debugging process. |
/debug: port [baudrate: baudrate] | Enables
kernel debugging over the specified port for troubleshooting
purposes.The [baudrate] optional parameter specifies the baud rate for
data transfer during the debugging process. |
/dudisable | Used to prevent a dynamic update from running during the installation process. |
/emsport:(comllcom2Iusebiossettingsloff)[/emsbaudrate:baudrate] | Configures
EMSto be enabled or disabled. The [baudrate] optional parameter
specifies the baud rate for data transfer during the debugging process. |
/m:folder_name | Used
with Setup to specify that replacement files should be copied from the
specified location. If the files are not present, Setup will use the
default location. |
/noreboot | Normally,
when the down level phase of Setup. exe is complete, the computer
restarts. This option specifies that the computer should not restart so
that you can execute another command prior to the restart. |
Itempdri ve: drive letter | Specifies
the location that will be used to store the temporary files for Windows
7 and the installation partition for Windows 7. |
lunattend: [answerfile] | Specifies
that you will be using an unattended installation for Windows 7. The
answerfi1e variable points to the custom answer file you will use for
installation. |
Next we'll look at the System Preparation Tool (Sysprep); using it is one of many ways to install Windows 7 automatically.
1. Using the System Preparation Tool to Prepare an Installation for Imaging
You can use disk images
to install Windows 7 on computers that have similar hardware
configurations. Also, if a computer is having technical difficulties,
you can use a disk image to quickly restore it to a baseline
configuration.
To create a disk image, you
install Windows 7 on the source computer with the configuration that you
want to copy and use the System Preparation Tool to prepare the
installation for imaging. The source computer's configuration should
also include any applications that should be installed on target
computers.
Once you have prepared
the installation for imaging, you can use imaging software such as
ImageX to create an image of the installation.
The System Preparation Tool (Sysprep.exe) is included with Windows 7, in the %WINDIR%\system32\sysprep
directory. When you run this utility on the source computer, it strips
out from the master copy information that must be unique for each
computer, such as the SID. Table 2 defines the command options that you can use to customize the Sysprep.exe operation.
Table 2. System preparation command-line options
Switch | Description |
---|
/audit | Configures
the computer to restart into audit mode, which allows you to add
drivers and applications to Windows or test the installation prior to
deployment |
/generalize | Removes any unique system information from the image, including the SID and log information |
/oobe | Specifies that the Windows Welcome screen should be displayed when the computer reboots |
/quiet | Runs the installation with no user interaction |
/quit | Specifies that the System Preparation Tool should quit after the specified operations have been completed |
/reboot | Restarts the target computer after the System Preparation Tool completes |
/shutdown | Specifies that the computer should shut down after the specified operations have been completed |
/unattend | Indicates the name and location of the answer file to use |
In the following sections, you will learn how to create a disk image and how to copy and install from it.
1.1. Preparing a Windows 7 Installation
To run the System Preparation Tool and prepare an installation for imaging, take the following steps:
Install
Windows 7 on a source computer. The computer should have a similar
hardware configuration as the destination computer(s). The source
computer should not be a member of a domain.
Log
on to the source computer as an administrator and, if desired, install
and configure any applications, files (such as newer versions of Plug
and Play drivers), or custom settings (for example, a custom Desktop)
that will be applied to the target computer(s).
Verify that your image meets the specified configuration criteria and that all applications are properly installed and working.
Select Start => Computer, and navigate to C:\WINDIR%\System32\sysprep. Doubleclick the Sysprep application icon.
The Windows System Preparation Tool dialog box appears. Select the appropriate options for your configuration.
If
configured to do so, Windows 7 will be rebooted into setup mode, and
you will be prompted to enter the appropriate setup information.
You will now be able to use imaging software to create an image of the computer to deploy to other computers.
In Exercise 1,
you will use the System Preparation Tool to prepare the computer for
disk imaging. The Sysprep utility must be run on a machine with a clean
version of Windows 7. If you upgraded a Windows Vista machine to Windows
7, you will not be able to run the Sysprep utility.
Log
on to the source computer as Administrator and, if desired, install and
configure any applications that should also be installed on the target
computer. Select Start => Computer, and navigate to C:\%WINDIR%\System32\sysprep. Doubleclick the Sysprep application icon. In the System Preparation Tool dialog box, select Enter System Out-Of-Box Experience (OOBE) in the system cleanup action. Under
the shutdown options, depending on the options selected, the System
Preparation Tool will quit, the computer will shut down, or the computer
will be rebooted into setup mode, where you will need to configure the
setup options. Choose the Reboot option. Click OK. Configure the Sysprep utility and name the image image.wim.
|
After creating the Sysprep
image, you need to use some type of third-party software to install it.
Windows includes a utility called ImageX for just that purpose.
2. Using ImageX to Create a Disk Image
After you've run the System
Preparation Tool on the source computer, you can create an image from
the installation, and you can then install the image on target
computers.
To create an image, you can use ImageX, which is a command-line utility that can be used to create and manage Windows image (.wim) files.
2.1. Creating a Disk Image
To run the ImageX utility to create a disk image of a Windows 7 installation, follow these steps:
Reboot the computer into the Windows Reinstallation Environment (PE).
At
the resulting command prompt, access the ImageX utility by typing
D:\Tools\ ImageX and entering the appropriate options. For example, to
create an image named Windows 7, you could enter the following command:
D:\ImageX.exe /capture C: C:\Images\image.wim "Windows 7" /verify
You
can copy the new image to a network share or to the local computer for
hardware disk duplication. To copy the image to a network share, you can
use the net use dir network share command along with the copy file dir command to copy the file.
In Exercise 2, you will use the ImageX utility to create a disk image of a Windows 7 installation.
Boot the computer into the Windows Preinstallation Environment (Windows PE). Type the following command in Windows PE, assuming that your DVD\CD drive is configured asthe D: drive: D:\ImageX.exe /capture C: C:\Images\image, wim "Windows 7" /verify Copy the new image to a network share at \\Server\Images by using the following commands: net use z: \\Server\Images copy C:\Images\image.wim z:
|
After you create the disk
image, the next step is to install the disk image. In the next section,
you'll learn to install the disk image to a new machine.
3. Installing from a Disk Image
After you've run the
System Preparation Tool and ImageX on the source computer, you can copy
the image and then install it on the target computer.
After the image is
copied, you should boot the destination computer into the Windows
Reinstallation Environment (Windows PE). If the computer has been used
previously, it may be necessary to reformat the hard drive, which you
can do using the disk part command in Windows PE. If the image is stored
over the network, you should then copy the image to the destination
computer by using the net use [dir] [network snare] and copy [file] [dir]
commands. Then, you should use the /apply option of the ImageX utility
to apply the image to the local computer. If an answer file has not been
deployed along with the image, you may have to apply such information
as regional settings, the product key, the computer name, and the
password to the new computer after the destination computer is rebooted.
In Exercise 3, you will use the stripped image that was created in Exercise 2 to simulate the process of continuing an installation from a disk image.
Boot the target computer into the Windows PE environment. Copy the image created in Exercise 2.4 to the local computer by using the following commands: net use z: \\Server\Images copy Z:\Images\image.wim C: Apply the image to the target computer using the following ImageX command: D:\ImageX.exe /apply C:\Images\image.wim C:
|
When you install Windows 7,
the installation wizard asks you questions such as your username and
computer name. There is a way to answer these questions without actually
being in front of the computer. As you'll see in the next section, you
can do this by using an answer file.