Introduction to Automated Windows Installation

Before you start

Objectives: learn which tools can be used to deploy different versions of Windows, where can you find them, when should you use them, and what are the basic steps when preparing automated installation.

Prerequisites: no prerequisites.

Key terms: automated installation, deployment, answer file, tools, sysprep, WAIK, reference


Windows Vista and Windows 7 Deployment

In business environments installing Windows in traditional way of entering the DVD and then manually configuring each installation is simply not administratively effective anymore. Because of that, we should be comfortable with automatic Windows deployment. There are several toolkits and individual tools which can be used to automate the Windows installation.

Microsoft Deployment Toolkit (MDT)

To automate deployment of Vista and 7 systems we can use Microsoft Deployment Toolkit (MDT), which is a free Solution Accelerator for operating system and application deployment. MDT supports deployment of Windows 7, Office 2010, and Windows Server 2008 R2 in addition to deployment of Windows Vista, Windows Server 2008, Windows Server 2003, and Windows XP. MDT contains detailed guidance and manuals on common deployment scenarios, as well as deployment console (workbench) with tools, images, and necessary tasks for desktop and server deployment. These tools provide complete automation for deploying Windows operating systems. The Microsoft Deployment Toolkit reduces deployment time, standardizes Windows images, limits service disruptions, reduces post-deployment help-desk costs, and improves security and ongoing configuration management.

MDT supports two distribution methods, LTI and ZTI. Lite Touch Installation (LTI) is a method of distribution which requires an image with a small amount of user intervention. It can be used without requiring any other distribution tools. Zero Touch Installation (ZTI) is a method of distribution that doesn’t require user intervention at all, but it does require additional tools. It requires Microsoft System Center Configuration Manager (SCCM) with the OS Deployment Feature Pack, and Microsoft SQL server.

All tools that come with MDT are available trough MDT deployment console. MDT is primarily used with Windows Deployment Services (WDS) server to enable the creation and automation of Windows images. Remember that MDT requires the Windows AIK to be installed as well (WAIK is described later in this article). MDT is available in 32-bit and 64-bit version.

The first step in using MDT to deploy images is to create a distribution share which will hold different images. Distribution share can also be used to manage and store files like applications, patches, updates, drivers and different settings for MDT. When talking about distribution shares we also have to know what is a deployment point. A deployment point is a subset of files in the distribution share which are necessary to install and configure Windows on a target computer. Deployment point defines the location of images, device drivers, updates and applications.

With MDT we can utilize the task sequences feature to add updates, language packs, system packages and applications to particular image. Task sequences can containing tasks and groups. Tasks are actions that are performed on some image. For example, task can be creating a partition, adding drivers, formatting the partition, installing operating system, etc. Groups are used to organize tasks that are related.

With MDT we can’t update offline WHD files that contain Windows installation. For managing offline WHDs we can use Offline Virtual Machine Servicing Tool. This tool requires System Center Virtual Machine Manager in addition to Windows Server Update Services and System Center Configuration Manager. With MDT we can add languages, and applications to offline images.

After completing the MDT steps, we can deploy images to our client computers either by using Windows Deployment Services (automatically) or by using LTI bootable media. If the computer does not support PXE booting, which is required to use the WDS, we can use the LTI bootable media to deploy the image. We can create the LTI bootable media from the deployment workbench.

System Image

Imaging is the process of taking a snapshot of the entire physical hard disk of the computer and storing it to a file, on some media. A system image is a single file containing all the contents of the Windows operating system installation and any additional files on a computer’s hard drive. The benefit of using an image is that we can customize the operating system with the software and settings that we prefer. Then we can deploy that customized system to any PC.

Prior to creating the reference computer and deploying a captured image of the reference computer, we have to install Windows Automated Installation Kit (Windows AIK). Both Microsoft Deployment Toolkit and Windows Automated Installation Kit (.iso file) can be downloaded from Microsoft site.

Windows Automated Installation Kit (Windows AIK or WAIK)

The Windows Automated Installation Kit (Windows AIK) is designed to help original equipment manufacturers (OEMs), system builders, and corporate IT professionals deploy Windows onto new hardware. The Windows AIK is a set of deployment tools which we can use to create, maintain and deploy Windows system images (WIM files).

By default, the WAIK is installed to the C:Program FilesWindows AIKdirectory. This directory contains all of the tools and documentation included in this release. The core tools used in most Windows deployment scenarios are:

  • Windows System Image Manager (Windows SIM) – used to open Windows images, create answer files, and manage distribution shares and configuration sets.
  • ImageX – tool used to capture, create, modify, and apply Windows images. ImageX is a command line tool. An image file contains a complete Windows installation. For example, if we have an existing computer that we set up the way we want, we can use ImageX to create a copy of that computer as a WIM image file which we can later use to deploy our custom Windows version to another computer.
  • Deployment Image Servicing and Management (DISM) – used to apply updates, drivers, and language packs to a Windows image. DISM is available in all installations of Windows 7 and Windows Server 2008 R2.
  • Windows Preinstallation Environment (Windows PE) – a minimal operating system environment used to deploy Windows. We can use it to boot up our machine. It has a CMD interface. WinPE can be customized with additional drivers and applications to help us with our troubleshooting and deployments. The AIK includes several tools used to build and configure Windows PE environments.
  • Windows Setup – used to install Windows. This tool is included in the Windows product DVD and is not part of the AIK installation.
  • Sysprep – used to prepare a Windows installation for imaging or delivery to a customer. With this tool we remove all the unique information of our source computer such as computer name and computer SID (Security ID). The Sysprep tool is available in all Windows installations in the%WINDIR%system32sysprep directory.
  • User State Migration Tool (USMT) – used to migrate user data from a previous Windows operating system to Windows 7. USMT is installed as part of the AIK in the %PROGRAMFILES%Windows AIKToolsUSMTdirectory.
  • oscdimg – used to create ISO images for the Windows PE boot disc.

Additional Tools

Application Compatibility Toolkit provides the ability to evaluate and mitigate application compatibility issues before deploying new versions of Windows or Internet Explorer in your environment.

Microsoft Assessment and Planning Toolkit Solution Accelerator enables you to assess your current IT infrastructure for a variety of technology migration projects. It includes the features previously provided with the Windows Vista Hardware Assessment Solution Accelerator.

Answer Files

Answer files are files that provide answers to prompts during installation to help automate installations. Answer files are now in the XML format. The default name for answer files is Autounattend.XML. We can also add device drivers and third-party applications to our XML files. Windows System Image Manager (Windows SIM) is a tool used to create and manage answer files that are used for automating Windows installations. When we run the Windows setup program, we point Setup to the answer file. The installation proceeds using the answers in the response file. If all of the necessary answers to setup configuration questions are included in the file, the installation will run and complete without our intervention. We can edit answer file to modify its settings and in that way change how Windows will be installed.

WIM Image Files

Prior to Windows Vista, a Windows installation media contained all the files necessary for the installation that were copied, one by one, to the target computer. With Windows Vista and Windows 7, the installation media contains premade generalized image of the Windows installation which is stored in WIM (Windows IMage File) format. With new Windows deployment methods, we use WIM image files which are file based, instead of older image files which are sector based. File based images give us more flexibility. The smallest unit of information in a WIM image is a file instead of a sector. A WIM image is hardware independent and has a unique single instance storage structure. Single instance storage allows a file to be stored once and be referenced multiple times within an image. That saves a lot of space. For example, if we take sector based image of an 4 GB Hard drive, we could deploy it only to the Hard drive that has at least 4 GB of space. Also, the hardware on the target computer had to be identical. With WIM files, file based images, we can deploy multiple versions of Windows to multiple types of hardware. With answer files we are able to completely automate the installation process.

Another advantage is that a WIM image can contain multiple disk images. These images are referenced either by numerical index value or unique name. Since WIM files use single instance storage, common information from different disk images within the WIM file are stored only once. WIM files can also be spanned or split into multiple parts. Each new part will have SWM extension. Since WIM images are file based we can use the ImageX command to mount a WIM image as a new volume with a drive letter. Then we can add, update or remove the content within that image. Before we can use ImageX we have to load WIM file system filter device driver.

XP Deployment

To create automated installation for XP we can use Deployment Tools which we can find on every Windows XP installation CDin folder supporttools or which we can download from Microsoft site. Just search for Deployment Tools for Windows XP and you should find a link to download deploy.cab file. When we have a deploy.cab file we have to extract content from it. The Deploy.cab file contains several tools that corporate administrators and IT professionals can use to deploy Windows XP to multiple computers. It includes tools like Setup Manager, System Preparation (Sysprep), Cvtarea and Oformat.

Setup Manager

We can use Setup Manager to create or modify the files that control an unattended Setup. Setup Manager can create answer files (unattend.txt) that can automate the installation of Windows XP on multiple computers. The unattend.txt file is an answer file which contains responses to questions that occur during the normal installation process. If we use the answer file, we don’t have to manually answer every question during the installation. When creating an answer file we can use the wizard inside of Setup Manager which makes is very easy. If we’re going to use the CD for the Windows XP installation, we will have to put our answer files on a Floppy disk and point to its location. Also, for CD-based setup, the answer file must be named Winnt.sif. With Setup Manager we can also create a distribution share point for network installations, and we have to put our answer file on the share as well. In addition to the Windows XP installation files, this network installation share can contain additional applications, drivers, additional commands to run at the end of Setup, and other custom components, as specified by the system administrator.

To install and run Setup Manager, copy the Setupmgr.exe file, which is located in deploy.cab file, to your hard disk. When running the installation we can use the following commands to include answer files during the installation:

  • winnt.exe /u:filename – filename is the location of the response file
  • winnt.exe /udf:filename – filename is the location of the UDF file

If we have many computers that we have to set up, we may want to have all the unique information prepared before we start the installation process. For example, every computer should have unique computer name. For that we can use the Uniqueness Database File (UDF) which can be created in Setup Manager. UDF contains unique data for multiple new computers, so we can use it to provide that information during the installation process on multiple computers.

All this is one way of preparing and doing an automated installation. In another method we can create and use image file. Then we can deploy that image on another computer. To create an installation image we have to have a reference computer which will use as our starting point. We install XP on a new reference computer and customize it. After that we run Sysprep to prepare it for imaging and then use disk imaging tool to create the installation image. That custom image can then be deployed to multiple computers.

We have a separate article in which we show where to find and how to work with Setup Manager in XP.

System Preparation (Sysprep)

Sysprep prepares a computer’s hard disk for disk duplication, auditing, and customer delivery. It is designed for corporate system administrators, OEMs, and others who deploy Windows XP to multiple computers. After completing the initial setup steps on a single computer, you can run Sysprep to prepare the computer for duplication. Sysprep assigns a unique security ID (SID) to each destination computer the first time the computer restarts. With Sysprep we can also configure user-specific information to be customized by the end-user when Windows starts the first time, create images of operating systems, duplicate disks, automate the Windows mini-Setup program or perform auditing tasks. The Sysprep.inf file is the answer file for the Sysprep.exe program. To build the Sysprep.inf file, run the Setup Manager Wizard.

Cvtarea and Oformat

Cvtarea is a tool for creating files and analyzing the placement of those files on a FAT32 or FAT file system. Oformat creates a FAT32 volume with clusters that are aligned in an optimal way for when the volume is later converted to NTFS file system format.

The Deploy.cab also includes detailed documentation that describes the latest features of the deployment tools and how to use them.

Server Operating Systems Deployment

Deploying server OS is very similar to deploying workstation operating systems. Server OS also use Answer files to configure the installation without user intervention. From Windows Server 2008, Answer files use the XML standard and are named Autoattend.xml. For Windows Server 2003 we used plain text files for Answer files. To create Answer files for Windows Server 2008 R2 OS we will also use the Windows System Image Manager (WSIM), which is available in the Windows Automated Installation Kit (WAIK) for particular Windows Server version, which can be downloaded from the Microsoft web site. The WAIK for Windows 7 also works for Windows Server 2008 R2, the WAIK for Windows Vista also works for Windows Server 2008, etc. The biggest difference from the workstation answer file and the server answer file is that the server answer file will contain information about the server roles that we want to install. The typical things that we will include in a server answer file are server (computer) name, network configuration, roles and features installation, and role configuration.

Windows Server versions prior to Windows 2008 will look on floppy disk for an answer file. From Windows 2008 we have support for removable USB devices, which makes things a lot easier. So, to perform an unattended installation we could simply insert a Windows DVD and the answer file on a USB device and start the installation. The configuration for the installation will then be read from the answer file on the USB disk. Keep in mind that if the answer file contains missing or incorrect responses, the installation will stop and wait for valid input.

Example Procedure

For example, lets say that we want to deploy custom Windows 7 installation to multiple computers. The first step in creating a custom installation is to build an answer file. We use an answer file to configure Windows settings during installation. The answer file contains all of the settings that are required for an unattended installation. We can create an answer file usingWindows System Image Manager (Windows SIM). After we finish creating our answer file (Autounattend.xml) we can copy it to the root directory of a USB flash drive (UFD) which we will use later while performing installations.

In step two we need to create a reference installation. A reference computer has a customized installation of Windows that we plan to duplicate onto one or more destination computers. We can create a reference installation by using the Windows installation DVD and an answer file which we have already created. After the installation we can also install all applications that we plan to use. After we are finished configuring our source installation, we need to prepare it for the end user. To do that we can use the sysprepcommand with the /generalize option to remove hardware-specific information from the Windows installation, and the /oobe option to configure the computer to boot to Windows Welcome upon the next restart.

If we don’t have one, in step three we create a bootable Windows PE RAM disk on a CD-ROM disc by using the Copype.cmd script. Windows PE RAM enables us to start a computer for the purposes of deployment and recovery. Windows PE RAM boots directly into memory, enabling us to remove the Windows PE media after the computer boots.

In step four we capture an image of our reference computer by using Windows PE and the ImageX tool. Then we store that image on a network share or Windows Deployment Services (WDS). After we have an image of our reference installation, we can deploy the image onto new hardware.

In last step we go to the target machine and boot up using WinPE, then use the DiskPart tool to format the hard drive if necessary, and then use ImageX to apply master image that we created previously. Of course, this is just an example of how it can be done and there are other ways to do it.

Remember

For XP automated installation we use Deployment Tools which we can find on every Windows XP installation CD (deploy.cab file). Deployment Tools inclue Setup Manager, System Preparation (Sysprep), Cvtarea and Oformat. Setup Manager can create answer files that can automate the installation of Windows XP. Sysprep assigns a unique security ID (SID) to each destination computer.

To automate deployment of Vista and 7 systems we can use Microsoft Deployment Toolkit (MDT). The WAIK is one of several resources that we can use to deploy Windows. The core tools used in most Windows deployment scenarios, and which we can find in WAIK are: Windows System Image Manager (Windows SIM), ImageX, Deployment Image Servicing and Management (DISM), Windows Preinstallation Environment (Windows PE), Sysprep and User State Migration Tool (USMT). Answer files are files that provide answers to prompts during installation to help automate installations. With new Windows deployment techniques we use image files which have a .WIM extension (Windows IMage Files), which are file based.

Paths that are mentioned in this article

Deployment Tools for Windows XP:

  • [CD drive]supporttoolsdeploy.cab

By default, the WAIK is installed to:

  • C:Program FilesWindows AIK

Example Articles

We have separate articles in which we show how to prepare the automated installation and create answer files:

Create an Answer File for Windows XP in Setup Manager