Windows Setup Installation Process

Applies To: Windows 7

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

Windows® Setup is the program that installs Windows or upgrades an existing Windows installation. It is also the basis for the following installation and upgrade methods: interactive Setup, automated installation, and Windows Deployment Services.

In This Topic

  • Windows Setup Installation Types

  • Windows Setup Process

  • Windows Setup States

Windows Setup Installation Types

Windows Setup can perform both clean and upgrade installations. However, it does not perform computer-to-computer migrations. Instead, you must use Windows Easy Transfer, the User State Migration Tool, or another migration tool to move data from a previous installation to the new operating system. For more information, see Understanding Upgrade and Migration.

  • Custom installations. Windows Setup can perform a custom installation, also known as a clean installation, which saves your previous Windows installation but does not migrate your settings. The previous Windows installation will not boot after a clean installation.

  • Upgrade installations. Windows Setup can perform an installation that retains your settings and preferences while upgrading your operating system. For more information, see Understanding Upgrade and Migration.

Windows Setup Process

The Windows Setup program starts and restarts the computer, gathers information, copies files, and creates or adjusts configuration settings. The following table shows the overall process for Windows Setup:

Windows Setup phase Setup actions

Downlevel (for custom installations and upgrades)

-OR-

Windows PE (for booting the Windows DVD or booting a custom Windows PE image)

  1. Specify Windows Setup configurations by using either the Windows Setup dialog boxes (interactive) or an answer file (unattended), or a combination of the two. Windows Setup configurations include adding a product key and configuring a disk.

  2. Apply answer file settings in the windowsPE configuration pass to configure the installation behavior and user experience.

  3. Configure the disk.

  4. Copy the Windows image to the disk.

  5. Prepare boot information.

  6. Process answer file settings in the offlineServicing configuration pass. The settings are applied to the Windows image before that Windows image boots. When the computer first boots, any packages, drivers, updates, or language packs are processed.

Online configuration

Create specific configurations, making the Windows installation unique.

Windows Welcome

  1. Apply answer file settings in the oobeSystem configuration pass.

  2. Apply content file settings from the Oobe.xml file.

  3. Start Windows Welcome.

Booting to Windows Welcome or Audit Mode

There are two modes that a Windows installation can boot to:

  • Windows Welcome

    Windows Welcome, also called Machine OOBE (out-of-box experience), is the first user experience. It enables end users to customize their Windows installation. End users can create user accounts, read and accept the Microsoft® Software License Terms, and choose their language and time zones.

    By default, all Windows installations boot to Windows Welcome first. This is to ensure that the end user accepts the Microsoft Software License terms. OEMs and System Builders are required to configure the Windows computer they ship to an end user so that it boots to Windows Welcome.

  • Audit mode

    Audit mode is used to add customizations to their Windows images. Audit mode does not require settings in Windows Welcome to be applied. By bypassing Windows Welcome, you can access the desktop quicker and make your customizations. You can automatically add additional device drivers, install applications, by using unattended Setup settings, or you can install applications and other requirements manually. Audit mode also enables you to test the validity of the installation.

For more information about audit mode, see Customize Windows in Audit Mode.

Oobe.xml Content File

In addition to the unattended Setup answer file, you can use the Oobe.xml content file to configure what customers see the first time they boot Windows. Settings in an Oobe.xml content file are applied after the oobeSystem configuration pass, before Windows Welcome starts.

For more information about using the Oobe.xml answer file, see the Oobe.xml Technical Reference.

Automatically Running Scripts After Windows Setup Completes

You can make additional customizations to your Windows installation by adding commands to the %WINDIR%\Setup\Scripts\SetupComplete.cmd file. This file enables you to install additional applications or make other modifications to the system before a user logs on. You can use the SetupComplete.cmd file to run custom Windows scripts (cscript/wscript).

In addition, if Windows Setup encounters a fatal error, you can configure the system to automatically run a script. For more information, see Add a Custom Script to Windows Setup.

Warning

Adding additional commands might increase the time it takes Windows Setup to complete. This might degrade the end users' first experience. Be aware of how much time your commands take, and consider the end users' experience when they first boot the computer.

Edition Configuration File (EI.cfg)

The edition configuration file (EI.cfg) determines what edition of Windows to install and what license to use during Windows Setup. If you are using an answer file to configure an unattended setup, use the ProductKey or MetaData components to automate the edition selection screen of Windows Setup. For more information, see Work with Product Keys and Activation. The EI.cfg file replaces PID.txt and is located on the product media under the \sources folder. If you are creating custom installation media—for example, recovery media—make sure the settings in your EI.cfg file match the installation sources. EI.cfg is a text-based file with the following format:

[EditionID]
{Edition ID}
[Channel]
{Channel Type}
[VL]
{Volume License}

Where {Edition ID} must be a valid Windows Edition ID. Use ImageX /info or DISM /Get-WimInfo to get the current EditionID. {Channel Type} can be OEM or Retail. {Volume License} can be 1 (True) or 0 (False). For example,

[EditionID]
Ultimate
[Channel]
OEM
[VL]
0

Note

If you use an answer file during Windows installation, Windows Setup ignores the EI.cfg file.

Windows Setup States

There are several states assigned to a Windows image during installation. This state information can be used to automatically detect the different states and stages of Windows Setup.

The Windows image state is stored in two places, in the registry and in a file.

  • In the registry:

    KEY: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State

    TYPE: REG_SZ

    VALUE: StateName

  • In a file:

    FILE: %WINDIR%\Setup\State\State.ini

    SECTION: [State]

    VALUE: StateName

The following table describes the values that exist for StateName.

State name Description

IMAGE_STATE_COMPLETE

The image has successfully been installed. The specialize and oobeSystem configuration passes are complete. This image is not deployable to a computer with a different hardware configuration because it is now hardware-dependent. To deploy this image to a computer with a different hardware configuration, you must run sysprep /generalize.

IMAGE_STATE _UNDEPLOYABLE

This is the default state for an image in a given phase of Windows Setup that is not yet complete. If a process queries the IMAGE_STATE value and IMG_UNDEPLOYABLE is returned, the image is in one of the following states:

  • Setup is currently running and has not fully completed the phase. Once a given phase is complete, the IMAGE_STATE will be set to an appropriate completion value.

  • If queried online while Setup is not running, there was a failure when completing a Setup phase. This image must be reinstalled.

  • If queried offline, the image did not complete a phase and will never be deployable.

IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE

The image has successfully completed the generalize configuration pass and will continue into OOBEsystem configuration pass when Setup is initiated.

IMAGE_STATE_GENERALIZE_RESEAL_TO_AUDIT

The image has successfully completed the generalize configuration pass and will continue into audit mode when Setup is initiated.

IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE

The image has successfully completed the specialize pass and will continue into OOBEsystem when Setup is initiated.

IMAGE_STATE_SPECIALIZE_RESEAL_TO_AUDIT

The image has successfully completed the specialize configuration pass and will continue into audit mode when Setup is initiated.

The following examples show how to access state information.

  • To access state information from the registry:

    C:\>reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State /v Imag
    eState
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State
        ImageState    REG_SZ    IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE
    
  • To access state information from a file:

    C:\>type %windir%\Setup\State\State.ini
    [State]
    ImageState="IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE"