USB Automatic Installation System
Networked Software Systems Laboratory
Eyal Koren & Leeor Langer
11/11/2009

1  Contents

1. Introduction 5

1.1. Abstract 5

1.2. Project Goal 5

2. Technology Overview 5

2.1. Unattended installation and quiet installation 5

2.2. Windows Automated Installation Kit (WAIK) 5

2.3. Windows preinstallation environment (WinPE) 6

2.4. HTML Application (HTA) 6

2.5. Cascading Style Sheets (CSS) 6

2.6. SysPrep 7

2.7. Visual Basic Scripting (VBscripts) 7

2.8. Windows Management Instrumentation (WMI) 7

2.9. DiskPart 8

2.10. Images capture, Windows imaging format, ImageX and deployment 8

2.11. USB 2.0 8

2.12. WindowsPE utility (Wpeutil) 8

3. Design 9

3.1. Basic Design Requirements 9

3.1.1. USB Data Source 9

3.1.2. Dynamic system 9

3.1.3. Flexible system 9

3.1.4. Minimum user's interference 9

3.1.5. GUI 9

3.2. General design 10

3.2.1. GUI 10

3.2.5. Data Base 11

3.3. Specific design 12

3.3.1. Gui general scheme 12

3.3.2 GUI detailed scheme: 12

4.1. GUI Stages 13

3.5. Data Base 17

3.5.1. Database levels For OS: 18

6.1.1. Database levels For Applications: 18

4. Administrator's related code (exposed code) 19

4.1. OS for unattended installation 19

4.2. OS for Image deployment 20

4.3. Applications. 21

5. End User Guide 23

5.1. Troubleshooting: 23

6. Project Evolution 24

6.3. Acquaintance with the Technologies 24

6.1.1. Manual Installation of Operating Systems 24

6.1.2. WAIK 24

6.1.3. Unattended Installations 24

6.1.4. WinPE 25

6.1.5. HTML 25

6.1.7. DiskPart 25

6.1.8. VBScript 25

6.1.9. Quiet Application Installation 25

6.3. Framework Design and Implementation: 26

6.4. Comprehensive Implementation: 27

6.5. Debug: 28

6.1.1. Capturing an image 28

6.1.2. Drive query 29

6.1.3. Unattended Installation Process 29

6.1.4. Partitioning Tool 29

6.1.5. Rebooting WinPE 29

6.1.6. Applications 30

2. Figures

Figure 1 10

Figure 2 11

Figure 3 12

Figure 4 12

Figure 5 13

Figure 6 14

Figure 7 14

Figure 8 16

Figure 9 17

Figure 10 18

Figure 11 18

Figure 12 20

Figure 13 21

Figure 14 22

Figure 15 22

Figure 16 26

Figure 17 26

Figure 18 28

1.  Introduction

1.1.  Abstract

The USB AUTOMATIC INSTALLATION SYSTEM provides the user a fast and easy way to create a full working station set in minimum effort and time, using only a USB device.

1.2.  Project Goal

The goal of the project is to build a dynamic automatic working station installation system, that can work from a portable USB.

In additional to that, the system should work unattended, and by that we mean that after supplying the system needed data and user's preferences, setting the working station would be fully automatic.

The system's main target audience are computer farms and lab's technicians, thou it can also be used by private computer owners.

2.  Technology Overview

2.1.  Unattended installation and quiet installation

Unattended installation refers to booting an operating system installation in an automatic way, with all the relevant data supplied by the user at the beginning of process.

Quiet installation refers to automatic installation of applications with no user's actions required through all of the process.

2.2.  Windows Automated Installation Kit (WAIK)

The WAIK is a collection of tools and technologies produced by Microsoft designed to assist in the boot and deployment of Windows operating systems.

The WAIK was first introduced with Windows Vista.

The main components of WAIK are the WinPE, SysPrep and ImageX.

Example: Creating an unattended file for Vista.

2.3.  Windows preinstallation environment (WinPE)

WinPE is one of the components of the Windows Automated Installation Kit (WAIK).

WinPE is a lightweight version of the common operating systems, and it is used as significant preinstallation tool.

WinPE main roles are to prepare the computer for windows installation, to copy disk images from source and to initiate windows setup.

WinPE can be launched from a variety of media, such as CD's and USB devices.

WinPE has the powerful capability of booting from a RAM disk,

Which enables it to make the necessary disk related operations.

The WinPE can be customized by selecting the packages added to it from a variety of packages, like HTA package, scripting package etc.

WinPE can also be customized by changing the booting prefrences.

Example: Used as a "launch pad" for running our GUI + environment.

2.4.  HTML Application (HTA)

HTA is a Microsoft Windows application written with HTML and Dynamic HTML.

HTA was introduced by microsoft.

In addition to the attributes of HTML, HTA supports files operations (creating, editing and removing) and registry entries.

HTML applications do not require compilation and are supported in custom WinPE packages.

Example: This is our choice of technology for creating our GUI.

2.5.  Cascading Style Sheets (CSS)

CSS is a style sheet language which controls the presentation features (looks and formatting) of the web page (in our case the HTA).

CSS is designed primarily to enable the separation of document content (written in HTA) from the document's presentation.

This separation provides more flexibility and control in the specification of presentation characteristics. It also simplifies the code by separating the elements in the code which are functional and those which are graphical.

Example: Used for our GUI's graphical capabilities.

2.6.  SysPrep

SysPrep is one of the components of the Windows Automated Installation Kit (WAIK).

SysPrep is used to prepare the operating system for capture disk and disk deployment.

SysPrep also "generalized" the unique characteristics of each computer, such as computer name and security identifiers, that they can be changed after deployment.

Example: Used before capturing a system image for deployment.

2.7.  Visual Basic Scripting (VBscripts)

VBscript is a scripting language, developed by Microsoft.

VBscript's syntax reflects its origin as variation of Microsoft's Visual Basic programming language.

A VBscript script must be executed within a host environment, such as Windows Script Host (WSH) and Internet Explorer (IE).

VBscripts enables writing executable functions, also in HTML/HTA pages.

The use of VBscripts in HTA enables the accessibility of the scripting to files and folders operations, such as creating, deleting, reading and editing.

The advantage of using in the project the VBscripts instead of other languages (java script, TCL …), is the compatibility to Microsoft's components and full support in custom WinPE and its powerful scripting capabilities.

Example: Our choice of technology for scripting functionality. This refers to all processes and functions used by the GUI for enabling the various unattended installation procedures.

2.8.  Windows Management Instrumentation (WMI)

WMI is a Management component that defines a set of environment-independent specifications which allow management information to be shared between management applications.

For example, WMI allows scripting languages like VBScript to manage Microsoft Windows personal computers and servers.

WMI also provides set of functions that can be used with scripting languages.

Example: Used for low level function calls such as querying HD information.

2.9.  DiskPart

Diskpart is a command-line hard disk partitioning utility.

In addition to creating the new partitions, Diskpart can also format, clean, activate and assign partition letter.

DiskPart supports the use of scripts to automate it's usage.

Example: Used for formatting, partitioning and more.

2.10.  Images capture, Windows imaging format, ImageX and deployment

Image capture refers to copying a disk, bit by bit and.

The capture is stored in Windows Imaging Format (WIM), and can

Be deployed later on other disk.

ImageX is the command-line tool used to create, edit and deploy Windows disk images.

ImageX is a part of the WAIK.

Images can be mount to add or remove data and then be unmount

to have a new image.

The deployment process is based on the Hardware abstraction layer (HAL), which refers to the seperation between the physical hardware and the software running on the computer.

The main advantage of the HAL is hiding diffrences in hardware, from the operating system's kernel.

The HAL was first introduced in windows vista.

Example: Used for capture and deploy.

2.11.  USB 2.0

USB 2.0 is high speed data transfer protocol.

Using USB device as the data source of the system is possible due to the USB 2.0 protocol speed.

2.12.  WindowsPE utility (Wpeutil)

The WindowsPE utility (Wpeutil) is a command-line tool that enables you to run various commands in a WindowsPE session. For example, you can shut down or restart WindowsPE, enable or disable a firewall, set language settings, and initialize a network.

Example: Used for rebooting.

3.  Design

3.1.  Basic Design Requirements

3.1.1. USB Data Source

The source of all data of the project and the system itself are all located on the USB.

3.1.2. Dynamic system

The system must be dynamic so new operating systems and applications can be added to data source (USB) and be ready for automatic installation with the minimum adaption needed and in elegant way.

The system must recognize the installation options in a dynamic way and present to the UI the options for the full working station set.

3.1.3. Flexible system

The system must support operations needed for future expandability. For example, adding new applications or OS options that require changing the code minimally, in specific predefined sections, in a user-friendly way, without knowing the full system code.

Parts of the code must be exposed to the System Administrator in order to support future OS and applications releases and updates.

3.1.4. Minimum user's interference

The system should be fully independent so that after entering in the beginning of the process the needed data such as OS type, wanted applications, computer's name and password (in the unattended process), the system will work independently until the creation of the full working station.

3.1.5. GUI

The system's user interface must be user friendly, and easy to use.

the GUI should take the user each step at a time in designing his wanted workstation and must be clear to first time user as well as to the expert user.

3.2.  General design

The general design of the system is composed of 4 main blocks, which interact one with the other.

The dynamic and flexible features of the system force all the 4 blocks to interact with each other.

3.2.1. GUI

In order to create a clean and organized code, we split 3 functionalities of the GUI to 3 areas in the code.

3.2.2. HTML\HTA Framework:

Our GUI is an HTML application in itself. HTML is the "backbone" of our project.

3.2.3. Graphics:

The user controls and graphics of our GUI are implemented in CSS.

3.2.4. Scripting:

All the actions performed by the GUI are implemented in VBScript. This includes temporary file creation, partitioning etc.

3.2.5. Data Base

Data base contains all the data needed for the installations and how to call this data.

The GUI's directory hierarchy enables us an orderly method for

sourcing the appropriate OS or applications.

3.3.  Specific design

3.3.1. Gui general scheme

The system's GUI is composed of several stages.

During each stage the user much choose between a few options.

After pressing the "next" arrow the next stage is instantiated.

This stage may be instantiated in different ways, depending on choices previously made.

The GUI may be divided to the following stages:

3.3.2 GUI detailed scheme:

4.1.  GUI Stages

3.4.1. Welcome screen:

The Welcome screen contains basic system information and instructions.

3.4.2. Partition:

In this step, the user is given the data of the disks (name, sizes, current partitioning) and select the partitions wanted and partitions options (formatting method, file system etc.).

The partition choices made in this step are used as input for creating PartitionScript.txt. This temporary script is called by the DiskPart utility after the user completes filling in the GUI.

All the partition related files are located in the Partition folder.

The next scheme, describes how our partitioning works.

After the user supplies the data, a temporary script is created from the template script. The temporary script contains all the relevant information supplied by the user. After the user completes filling in the GUI form, diskpart is called with the temporary script.

This same process applies to the Clean, Create and Delete options. The difference is that these 3 occur on-the-fly and not adjacent to the installation process.

Refresh function is called after each partition action. The ‘Current Partition Table’ is composed of parsed WMI calls

for system information.

3.4.3.  OS general choice:

All the OS offered for installation in level 1 (as shown in figure X) are loaded to the current page, for the user's selection.

The OS options are dynamically loaded from the OS folder by the same name.

3.4.4.  OS specific choice:

According to level 1 selection, the level 2 relevant data options are loaded to the current page, for the user's selection.

As in last step, the options are loaded dynamically.

Both general and specific OS selections are concaternated to a global variable called strOS. This variable contains the path of the specified OS and will be used in the installation\deployment process.

3.4.5.  User info:

In this step, the user provides, if asked, data such as computer name, password, product key etc.

The data is asked only when the OS installation chosen was unattended.

If the installation is a deployment one, no data is required from user.

The data from user is used to create a temporary unattended file.

The unattended file template is located in the OS folder. After completing the GUI, the unattended installation call is used with an "unattended" flag and the temporary unattended file is sourced also.

3.4.6.  Applications:

If the process is unattended installation, the system will offer the user a variety of applications to choose from for installation. This collection of application are found in the "Apps" directory and is loaded dynamically, like the rest of the GUI stages.

If the process is image deployment, the application selection will not be possible.

In this stage, the selection of applications will generate a batch file (all_inst.bat) that contains all the command lines of each application installation. The all_inst.bat file will later be executed and will install all the applications in serially, without contention.