Using Windows System Image Manager
The Windows System Image Manager (WSIM) is installed when you install the WAIK. You can access it by clicking Start → All Programs → Microsoft Windows AIK → Windows System Image Manager. You can use WSIM to create unattended Windows Setup answer files to automate the installation of Windows 7. Instead of a user answering the questions for an installation, the answer file can provide all the information. Additionally, you can modify the default behavior of the installation with an answer file.
WSIM comes in both x86 and x64 (32-bit and 64-bit) versions. It's important to use the version that matches the image of your reference computer. For example, if you try to use the x64 version to create a catalog for an x86-based image, it will fail. However, you can use the x86 version to create catalogs for both x86- and x64-based images.
Exploring the Panes: An Overview of WSIM
When you first open WSIM, it has almost nothing in it. However, once you start creating an answer file, the different panes of WSIM start displaying some important information. Figure below shows WSIM with an image opened and an answer file started. In the figure, you can see the various panes of WSIM:
- Distribution Share: A distribution share is a set of folders that contain files you can use to customize the Windows installation. This can be a local folder that includes items that will be installed after the installation, or a network share available to the system after the installation. Windows Setup will use the path defined here to install additional applications and drivers. When you create the distribution share, it creates the three folders shown in the Distribution Share pane.
- Windows Image: The Windows Image pane shows the selected image and available components and packages that can be defined for the image. The figure shows an image named Windows 7 ULTIMATE added with the available components. As you can see, many components can be added. You can add components to the answer file by right-clicking them and selecting Add Setting. Different settings are added to different passes of the installation. You can add packages by right-clicking them and selecting Add To Answer File. Instead of selecting an image here, you can select a catalog file for the image if one exists.
- Answer File: This pane shows the answer file as you're building it. This pane starts empty, but as you add components and packages from the Windows Image section, it becomes populated. In the figure, only one component has been added: x86_Microsoft-Windows-Setup_ neutral. This has two sections: UserData (selected) and ProductKey.
- Selected Components' Properties and Settings: When you select a component in the Answer File pane, the available properties and settings for the component appear. You can then configure the settings as desired. For example, the AcceptEula setting has been configured with a value of True and an organization name has been added. Some properties have specific data types you can select (such as true or false) whereas other properties allow you to enter the data as free text.
- Messages: The Messages pane includes different messages for you while working with an answer file. For example, if you select Tools → Validate Answer File, it will check for any issues. In the figure, the validation has identified that the ProductKey setting doesn't have a value and the message indicates this will be not be added to the answer file.
Understanding Catalog Files
A catalog file (.clg) is a binary file that contains the state of all the components and packages within a Windows image. If you look back at Figure above, you'll see that the Windows Image pane has been expanded to show the available components for the image, and one of the components has been added to the answer file. This list is derived from the catalog file.
An answer file with the available packages expanded. You can right-click any of the packages and select Add To Answer File. After adding the package, you can select package components, and configure their properties. and settings sections of the answer file.
The installation DVD includes separate catalog files for each image within the install.wim file in the sources folder. If you're using a default image, you can simply copy one of these catalog files to your technician's computer when you copy the install.wim file. Alternately, you can use WSIM to create a catalog file. WSIM queries the image and creates a list of the settings in the image to create the catalog. If you update the image, you need to re-create the catalog file. For example, if you use DISM to add or remove packages, the catalog file needs to be updated to reflect these changes.
When you open an image in WSIM, it looks for the catalog file for the image. If it can't locate the catalog file, it will prompt to you create one. If you launched WSIM with administrative permissions, you can simply click Yes and it will create the catalog file.
Be careful, though. There are several known reasons why the catalog file creation will fail, including the following:
- When the WIM File Is Read-Only or in a Read-Only Location: The location includes the installation DVD. You need to copy the image file to your hard drive.
- When You're Trying to Create an x86 Catalog from an x86 Image on an x64 Technician's Computer: If the WAIK is installed on an x86 technician's computer, the x86 version of WSIM will run and you can use it to create both x86- and x64-based catalogs. The help file indicates that you can use the x86 WSIM to get around this problem, but it isn't available if you installed the WAIK on an x64 computer.
- When You're Using It for a Nonsupported Version: For example, you cannot create a catalog file for Windows Vista RTM version.
Exploring the Components of an Answer File
The answer file has several components based on seven configurable passes of an installation. Different components of an answer file:
- windowsPE
- offlineServicing
- generalize
- specialize
- auditSystem
- auditUser
- oobeSystem
You can look at sample unattended XML files if you've installed the WAIK. Several sample files are stored in the C:\Program Files\Windows AIK\Samples folder. You will need to add the UserData/ProductKey/Key information into the answer file or enter it manually during the installation. These files are architecture specific; in other words, some answer files are for x86- based systems and others for 64-bit systems. The section "Viewing Sample Answer Files" later in this article shows how you can open these files in WSIM.
Pass 1: windowsPE
Pass 1 includes many of the basic Windows preinstallation options as well as some basic setup options. The Setup section expanded to show many of the available options that can be added to the answer file. If you right-click over any of the items, the context menu appears.
In the figure, the ModifyPartition component is selected, and it shows that the setting can be added to Pass 1. Most items can be added to only a single pass, but some items can be added to different passes. For example, the ExtendOSPartition item available in the Windows Deployment section (not shown in the figure) can be added to Pass 3, 4, 5, or 7. The good news is that you don't have to remember which passes are available for each item. WSIM only allows you to choose valid selections; invalid selections are dimmed.
Pass 2: offlineServicing
You can use the offlineServicing service to apply updates, drivers, or language packs to a Windows image. Any settings in the offlineServicing section of the answer file are applied after the Windows image is applied to the hard disk and before the computer reboots. This allows you to install and process any third-party device drivers you may need for special devices. There aren't many components and settings available for this section of the answer file. For example, if you have drivers that need to be available before the image is applied, you can add the Microsoft-Windows-PnpCustomizationNonWinPE component. You can then add the path to device drivers to this component.
Pass 3: genera lize
You run the generalize pass only if you prepared your image with Sysprep. During this pass, the system-specific information (such as the SID and other hardware-specific settings) on the computer is removed. Even when the generalize pass is run, there aren't many additional settings that are commonly added to this pass.
However, if you have any third-party drivers that are included in the image and you want them to be included in the final image, there is an important setting you must add. The PnpSysprep component being added. It is added to the Pass 3 generalize answer file section.
The PersistAllDeviceInstalls value can be changed from false to true to keep these third-party drivers. When you change the value to true, all the unique device drivers for a system are not removed from the installation image.
Pass 4: sp ecialize
This pass creates and applies computer-specific information. It runs after the first boot and creates the SID for the computer. You can configure a wide variety of settings during this pass, such as network settings, additional Windows features, and domain information.
The Internet Explorer settings are shown being added in the Windows Image components. The figure also shows some the settings available for Internet Explorer in the Answer File and Properties sections. The UnattendedJoin component, which allows you to specify details for joining a domain, has been added, along with the Windows-Defender component.
You can also configure network settings and international settings during this pass.
Pass 5: auditSystem
Pass 5 is used only when a system is configured to boot to Audit mode from Sysprep. The auditSystem pass can be modified to add additional configurations to an image, such as adding third-party drivers by an OEM, but you may not use it in an organization.
Pass 6: auditUser
Similar to Pass 5, the auditUser pass is used only if you boot into Audit mode after running Sysprep on a system. You can use this pass to run custom commands or configure Windows Shell options, but you may not use it for typical unattended installations.
Pass 7: oobeSystem
The last pass applies settings to Windows before the Windows Welcome phase begins. You can use this pass to modify Registry settings, create user accounts, and specify language and locale settings. It also includes many settings used by OEMs.
The Windows-Shell-Setup component includes several settings that you can add to modify the initial setup of Windows for your end users. Notice that the Windows-Shell-Setup section includes settings that can be added to all the passes except for Pass 1. You can also see that you have many different settings you can add in this section.
Creating an Unattended Answer File
This section shows you how to create an unattended answer file on a technician's computer that can be used for unattended installation. These steps are divided into five major areas:
- Adding an image to WSIM
- Adding components to the answer file
- Configuring the components in the answer file
- Testing and saving the answer file
- Viewing sample answer files
The following steps show how to create an unattended answer file on a technician's computer that can be used to boot a system into the Sysprep Audit mode without user invention. They require a copy of a WIM file on the computer's hard drive. If desired, you can copy the install .wim file from the sources folder of the installation DVD onto the hard drive or copy an image that you have captured. You can also copy the associated CLG file so that WSIM doesn't have to re-create it since this process can take quite a while.
Add ing an Ima ge to WSIM
The first step is to add an image to WSIM. These steps assume you have copied an image file onto your system's hard drive. The available components reflect what is available in the image.
- Launch WSIM with administrative permissions by clicking Start → All Programs → Microsoft Windows AIK, right-clicking Windows System Image Manager, and selecting Run As Administrator.
- Select File → Select Windows Image. Browse to the location of the WIM file you want to use. Select the file and click Open. If the file has multiple images, you'll be given a choice. Select the desired image and click OK.
- If you didn't copy a catalog file with the image, you'll see a prompt indicating that a catalog file isn't available. A prompting you to create one, click Yes to create the catalog file. Remember that this process will fail if you're running WSIM on a 64-bit computer but trying to create a catalog for an x86 image.
- Select File → New Answer File. You'll see the Windows Image pane become populated with components. You can add these components to your answer file.
At this point, you have the shell of your answer file, but it doesn't have any content. Next you'll learn how to add components to the answer file and configure settings.
Add ing Comp onents to the Answer File
Once you have created the shell of your answer file, you can begin to add components. The following steps lead you through the process of adding components for basic disk configuration and Windows Welcome settings:
- Expand the Components section in the Windows Image pane of WSIM.
- Browse to the Microsoft-Windows-Deployment\Reseal component. Right-click it and select Add Setting To Pass 7 oobeSystem.
- Browse to the Microsoft-Windows-International-Core-WinPE\SetupUILanguage component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Use the following steps to add settings to create the first partition:
- Browse to the Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Browse to the Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Use the following steps to add settings to create a second partition:
- Browse to the Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Browse to the Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Browse to the Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Browse to the Microsoft-Windows-Setup\UserData component. Right-click it and select Add Setting To Pass 1 windowsPE.
- Browse to the Microsoft-Windows-Shell-Setup\OOBE component. Right-click it and select Add Setting To Pass 7 oobeSystem.
At this point, the minimal components are added to the answer file.
The next section shows how to configure the properties of the components that you have added to the answer file.
Configuring the Comp onents in the Answer File
You can use the following steps to configure the properties of the components of an answer file. These steps assume you have added the components to the answer file in the previous section.
- If necessary, expand the 1 windowsPE section in the Answer File pane.
- Select the Windows-International-Core component. Enter the following values in the settings section:
InputLocale: en-US SystemLocale: en-US UILanguage: en-US UserLocale: en-US
- Select SetupUILanguage within the Windows-International-Core component. Enter the following value:
UILanguage: en-US
- If necessary, expand the Windows-Setup section. Select the Microsoft-Windows-Setup\ DiskConfiguration component. Select OnError for the WillShowUI setting.
- Select the Microsoft-Windows-Setup\DiskConfiguration\Disk component. Enter the following values in the settings section:
DiskID: 0 WillWipeDisk: true
- Use the following steps to configure the first partition. Select any of the Microsoft-
Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition components. Enter the following values in the settings section:
Extend: false Order: 1 Size: 200 Type: Primary
- Use the following steps to configure the second partition. Select the Microsoft-Windows-
Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition component. Enter the following values in the settings section:
Extend: true Order: 2 Size: <blank> Type: Primary
- Modify the first partition with the following steps. Select any of the Microsoft-Windows-
Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition components. Enter the following values in the settings section:
Active: true Format: NTFS Label: System Order: 1 PartitionID: 1
- Modify the second partition with the following steps. Select the Microsoft-Windows-
Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition component. Enter the following values in the settings section:
Active: false Format: NTFS Label: Windows Order: 2 PartitionID: 2
- If necessary, expand the ImageInstall section in the 1 windowsPE section. Select the
Microsoft-Windows-Setup\ImageInstall\OSImage component. Enter the following values in the settings section:
InstallToAvailablePartition: false WillShowUI: OnError
- Select the Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo component. Enter the following values in the settings section:
DiskID: 0 PartitionID: 2
- Select the Microsoft-Windows-Setup\UserData component. Enter true for the AcceptEula setting.
- Select the Microsoft-Windows-Setup\UserData\ProductKey component. Enter the following settings:
Key: <Enter your product key here> WillShowUI: OnError
- If necessary, expand the 7 oobeSystem section. Select the Microsoft-Windows-
Deployment\Reseal component. Enter the following values in the settings section:
ForceShutdownNow: false Mode: Audit
The Audit mode is most commonly used by OEMs. It allows you to boot skip the Welcome phase on the next boot and add additional drivers or applications. - Select the Microsoft-Windows-Shell-Setup\OOBE component. Enter the following values in the settings section:
HideEULAPage: true ProtectYourPC: 3
At this point, the answer file is configured. However, it's possible that some of the settings were missed or misconfigured. You can validate the answer file before saving it to identify any possible problems. The following section shows these steps.
Testing and Saving the Answer File
The validation step within WSIM can be used to test the answer file. If you followed the previous steps to create the answer file, you can use these steps to validate it. After it's validated, you can save the file for later use.
- Select Tools → Validate Answer File. You should see a message indicating that no warnings or errors were discovered.
If you have any errors, double-click the error to navigate to the setting and correct the problem. After correcting the problem, validate the answer file again until you no longer have any warnings or errors. - Select File → Save Answer File. Browse to a location on your system and save the file as Autounattend.xml.
You now have a basic answer file you can use to automate Windows Setup. If you copy it to a USB flash drive and boot to the installation DVD, the autoattend.xml file will automatically be used for the installation.
Viewing Samp le Answer Files
There are literally hundreds of settings that can be configured and there simply isn't enough room in this article to cover them all. However, the WAIK does include some sample answer files that show more of the components and settings that may interest you.
The following steps show how to add the sample answer files to the WSIM so that you can browse them to see additional settings. You need to first add an image; the image we used in step 2 in the section "Adding an Image to WSIM" earlier will work. If you still have WSIM open from the previous series of steps, click File → Close Answer File first.
- Click File → Open Answer File.
- Browse to C:\Program Files\Windows AIK\Samples.
- Select one of the sample XML files such as autounattend_sample.xml or Corp_autounattend_sample.xml. Click Open.
- You will be prompted to associate the answer file with the image within WSIM. Click Yes.
- Expand the different elements to view them. Notice that the validation shows a problem with the key. If you double-click it, it will bring you right to the error. This sample doesn't include a product key, but it does show you where you need to enter your product key.
If desired, you can open additional sample answer files and view their settings.
In this tutorial:
- Automating Windows 7 Installation
- Creating Your First Image
- Using the Windows Automated Installation Kit
- Creating Bootable WinPE Media
- Preparing a System with Sysprep
- Capturing an Image Using ImageX
- Applying an Image Using ImageX
- Customizing Images Using Deployment Image Servicing and Management
- Using Windows System Image Manager