USB Automatic Installation System

foregoinggowpenSoftware and s/w Development

Nov 4, 2013 (4 years and 7 months ago)

164 views















USB Automatic
Installation System

N
etworked Software Systems Laboratory

Eyal Koren & Leeor Langer

//1//11111







1

Contents

1.

Introduction

5

1.1.

Abstract

5

1.2.

Project Goa
l

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 Basi
c Scripting (VBscripts)

7

2.8.

Windows Management Instrumentation (WMI)

7

2.9.

DiskPart

8

2.10.

Images cap
ture, Windows imaging format, ImageX and deployment

8

2.11.

USB 2.0

8

2.12.

Windows

PE 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.

F
lexible system

9

3.1.4.

Minimum user's interference

9

3.1.5.

GUI

9

3.2.

General
design

10

3.2.1.

GUI

11

3.2.5.

Data Base

12

3.3.

Specific design

12

3.3.1.

Gui general scheme

12

3.3.2

GUI detailed scheme:

13

4.1.

GUI Stages

14

3.5.

Data Ba
se

18

3.5.1.

Database levels For OS:

18

6.1.1.

Database levels For Applications:

19

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

25

6.1.3.

Unattende
d Installations

25

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.

Una
ttended 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

11

................................
................................
................................
....

18

Figure

11

................................
................................
................................
....

18

Figure

12

................................
................................
................................
....

20

Figure

13

................................
................................
................................
....

21

Figure

14

................................
................................
................................
....

22

Figure

15

................................
................................
................................
....

23

Figure 16

................................
................................
................................
.....

26

Figure

17

................................
................................
................................
....

26

Figure 18

................................
................................
................................
.....

28





























1.

Introduction


1.1.

Abstract

The

USB AUTOMATIC INSTAL
LATION SYS
T
EM

provides the
user
a

fast

and eas
y

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 bui
ld a dynamic automatic working
station installation system, that can work from a portable USB.

In additional to that, t
he 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 targe
t audience are computer farms and
lab's
technicians, thou

it can also be used by private computer owners.


2.

Technology Overview


2.1.

U
nattended installation and
quiet installation

U
nattended installation refers to boot
ing

an operating system

installation
in an
automatic way,
with

all

the relevant data supplied
by th
e user

at the

beginning of process.

Q
uiet 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.

W
i
n
dows 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 capabi
lity 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, scriptin
g 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 t
o 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
H
TA
) from
the
document
's

presentation
.

This separation provide
s

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

(
VBscr
ipts
)

VBscr
ipt is a

scripting

language, developed by
Microsoft
.

VBscr
ipt's

syntax reflects it
s origin as variation of Microsoft's
Visual Basic

programming language.

A
VBscr
ipt script must be executed within a host environment,
such as
Windows Script Host

(WSH) and

Internet Explorer

(IE).

VBscr
ipts enables writing executable function
s, 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
languag
es (java script, TCL …)
, is the compatibility to M
icrosoft
's

com
p
onents

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 use
d by the GUI for enabling
the various unattended installation procedures.


2.8.

Windows Management Instrumentation
(WMI)

WMI is a Management component that define
s

a set of
environment
-
independent specifications which allow management
information to be shared between management applications
.

For example,
WMI allows
scripting lang
uages

like
VBScript

to
manage
Microsoft Windows

person
a
l 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.

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

Example:

Used for formatting, partitioning and more.


2.10.

Image
s

capture, W
indows 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), a
nd can


Be deployed later on other disk.


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

d
isk 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 compu
ter.

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:

U
sed for capture and de
ploy.


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 possib
le due
to the USB 2.0 protocol speed.


2.12.

Windows

PE utility

(Wpeutil)

The Windows

PE utility (Wpeutil) is a command
-
line tool that
enables you to run various commands in a Windows

PE session.
For example, yo
u can shut down or restart Windows

PE, 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 p
roject
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
elegan
t 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 appl
ications or O
S 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 b
e fully independent so that after entering in the
beginning of the process the needed data
such as O
S 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
mu
st be user friendly, and easy
to use.

the GUI should take the user each step at a time in designing his
wanted worksta
tion 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 dynami
c and flexible features of the system
force all the 4

b
lock
s

to interact with each other.














































Figure

1



GUI


Framework

HTA


Scripting

VBScripts

CSS Graphics

3.2.1.

GUI


In order to crea
te 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 i
mplemented in
CSS.


3.2.4.

Scripting
:


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






























Actions performed by GUI

User

Figure

2



Reboot

MS
installion
\
deployment
process

3.2.5.

Data
B
ase

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
:











Level 1

Level 2

Figure

3

Figure

4



Welcome
Screen

Partition

OS General
choice

OS Specific
Choice

Unattended
File Data

application
for selection

ReBoot

3.3.2

GUI

detailed scheme
:















































No user
data

No
applications

U
ser Info step

Applications step

Image
installation

Unattended
Installation

Figure

5



4.1.

GUI Stages


3.4.1.

Welcome screen
:


T
he Welcome screen contains basic system information and
instruction
s
.



3.4.2.

Partition
:


I
n 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 tempo
rary 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.













T
he next scheme,
describes

how our pa
r
titioning 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
tempora
ry script.














DiskPart

Figure

6

Figure

7



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 th
e OS offered for insta
l
l
ation

in level 1

(as shown in figure X)
are loaded to the curre
nt 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

a
re concaternated to
a
global

variable called
str
OS
.

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 s
tep, the user provide
s
, 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.

Th
e 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 sour
ced
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 application
s

will generate a batch file

(all_inst.bat)

that con
tains all the command lines of each

application installation. T
he all_inst.bat file will later

be executed
and will install all the application
s

in serial
ly, without contention
.

The system
currently

has 3
o
ptions for applications
.

T
he addition of new applications for installment
is

described in the
administrator
section, but it's worth mentioning that adding
applications is easy and intuitive due to the flexibility
demands of
the project mentioned above
.

















3.4.7.

Reb
oot
:


A
fter
all
steps

are

completed, the system starts

several processes
and upon completion, the WPEutils reboot function is called
.

This step is different for unattended installation and for

deployment.

Figure

8



Launch
unattended

unattended
file creation

Diskpart

Launch
Installation
script

Reboot

Launch
Deployment

Diskpart

Image
Operations

Launch
Deployment
script

Reboot









Unattended installation:


















Image deployment:




















Unattended
Process
starts :

周楳T
晵湣瑩潮o
ca汬猠s汬⁴桥
晵湣瑩潮猠
湥e摥搠景爠
畮u瑴e湤n搠
楮獴a汬a瑩潮⸠


Unattended
file is
created with
the user's
inputs.

(winnt.sif)

Temporary
partition
script
is
created.

Diskpart
launches
with this
Partition
script.

周楳⁳c物灴r
ca汬猠s渠
exec畴慢汥
晩汥 浥搠
睩湮琳㈮數e,
睨楣栠
楮i瑩a瑥猠瑨t
楮獴a汬a瑩潮⸠

W灥畴u汳l
牥扯潴b⁴桥
sy獴敭s

䑥灬pyme湴n
P牯re獳s
獴慲瑳›

This
function
calls all the
functions
needed for
deployment.




Temporary
partition
script is
created.

Diskpart
launches
with this
Partition
script.


佰O牡瑩潮猠
牥污瑥搠瑯†
I浡来
c桯獥渠景n
摥灬py浥湴m


I浡来堠
畴u汩ty⁩猠
ca汬e搠睩瑨d
瑨攠
a灰牯p物r瑥t
晬fg猠景f⁴桥
c畲ue湴n
業age.

W灥畴u汳l
牥扯潴b⁴桥
sy獴敭s

Figure

9







3.5.

D
ata

B
ase

As
described before
, the database
is
composed
of data

levels as
shown in scheme :













-























3.5.1.

Database levels
For OS:

Level1: contains all OS options

for

the

user

(XP,Vista,
Windows7

).

Level2
: contains al
l v
ersions of the
Level1 OS choices

(
SP1,SP2,images…
).

OS

Database

XP

unattended

XP

ImageXP

Vista

1
ImageVista

ImageVista
2

windows
7

Windows
7

Image

applications

Winrar

Winrar
Setup
command

Winrar
setup

Winzip

Winzip
Setup
command

Winzip
setup

Level1

Level2

Level1

Level2

Figure

10

Figure

11




6.1.1.

Database levels For Applications:


Level1
: contain all applications
available for installation.

Level2
: contain all application setup files

(usually an executable)

and setup commands for
quiet

installations

(bat file w
ith
appropriate flags)
.


4.

Administrat
or's related code

(exposed code)



The system
design must support easy add
ition

of new OS and
applications with
no

code modification.

Here we will detail the steps
for adding new components to the system.


4.1.

OS for
unattended installation


The distinction between OS Image and OS for unattended
installation is that every OS for unattended installation co
ntains the
phrase "unattended" in it
s name.

This is the naming convention we
used to make a distinction between una
ttended installation and
image deployment.


Unattended installation is an old technology that simulates the
installation process without the need for a user during the process.

Deployment
of an

image is possible only after capturing this
image.Before Vist
a, image capture was hardware dependant, so an
image from a certain computer cannot be deployed to another
computer.

Vista introduced the HAL
-

Hardware Abstraction Layer. This layer
removes the HW
-
SW(OS) dependency. This means that we can
deploy a vista im
age on many different computers, thus making the
unattended process obsolete.


In addition, the difference between unattended files of the exist
ing

OS and the future OS, make the unattended
installation
complicated for future assimilation.








Because

of the above

reasons, we
support only unattended
installation of XP, and
don’t
support unattended installation
of
Vista

or future OS

(not to say that this is not possible)
.




For new application
addition (only versions of

XP):

A.

Create

in the
XP

folder

a new folder which its name is
the OS
option that will appear in the GUI
.

T
he

OS

name must contain the phrase
"
unattended
".

B.

In the new folder, create two
files: the

first is the the
unattended file, named winnt.sif.
The

second is a bat file that
activates the
execute file
winnt32.exe for

unattended installation.

The bat file must have the same name like the folder it located in,
and it must have the required flags for unattended installation.


























4.2.

OS for Image deployment

As described in 3.4.1, the
preferred installation method is image
deployment.

For new Image addition :

A.

c
apture an image using
imageX
.

B.

create a new folder
for the Image. If the image is a version of
an existing OS (like a new image with the latest ServicePack), put
the folder under the matching OS folder.

Installation flags

unattended file
path

Figure

12



If the Image is a new OS that doesn't exist in the system at all,
creat
e under the OS folder, a new folder with the new OS name,
and put the image in the new folder.

C.

copy the new image to the folder (by same

name), and

create
the batch file with the same Image name.



































4.3.

Applications
.

Every application in level 3 has a relevant batch file in level 4, and
the setup file in the same folder.

The batch file contain the command line
for setup has the relevant
flags for quick installation.


For new application addition :

Image File

Deployment the VistaImage1
in drive C:

Figure

13



A.

Create a new folder in the apps folder. Rename the folder

by a

name suitable for identification in the application step.

B
.

copy the application's setup file

into the folder

and rename it
the same as the folder
.

C.

Create a batch file with the command line executing the setup
file. Be aware that the command line must include the setup file
path and the quiet installation fl
ags.

For example, lets take a l
ook on the two

installation
s
. The

folders
and file has a leveled structure
, as can be shown in the winrar
installation:

















The installation command line
is :









The winzip installation files are leveled in the similar way:














Quiet installation
flag

Setup file path

Figure

14










The installation command line is
:






5.

End User Guide


5.1.

Troubleshooting:




Which FileSystem to use?


Answer: choose ntfs for current MS OS. You may

do this by entering 'ntfs' in lowercase letters

(no need to enter the ''!).




Which format flags to use?


Answer: No need to enter any flags for default installations.

You may use 'quick' for debug purposes.




Which letters to choose for my partitions?


Answer: Use 'c' for your OS installation logical drive only.

Use other letters ('d,e,f...') for different pa
rtitions. Do

not enter 'x:' as your letter, only 'x' (where 'x' refers to

all letters!).





Which installation methods to use?


Currently the system supports unattended installation for XP

only. Image deployment is supported for Vista OS and Win7.

Quiet installation
flag

Other
installation
flags

Setup file path

Figure

15



These technologies are the most suitable for the OS above

(see Vista
\
Win7 HAL for explanation of image deployment...).





How to configure

my
BIOS

to support USB boot?


1.

Check that booting fro
m USB is supported.

2.

Boot order must be Hard disk first and
USB second.

3.

Boot from USB only when initiating the GUI.




How to
change
\
upgrade my WinPE image?


See the walkthrough in the ReadMe documentation or check out
Microsoft TechNet for step by step guides.



6.

Project Evolution


Th
is project is not programmatically difficult. Most of the code is
simple and the GUI itself is an HTA. The difficulties of this project
are different than standard project at the Network Software Lab.

Understanding how to work with the different technologi
es and
integrating them together into a complete product is the main
difficulty. We will explain in detail what we accomplished and the
phases of development that we completed.


6.3.

Acquaintance with the Technologies


Before

starting the actual coding of the GUI, we had to familiarize
ourselves with the many technologies in order to understand and
experiment with all the different options ahead. This phase is
important because of two reasons: First, we

had to choose which
tec
hnology is best for our needs. Second, we had to gain a deep
understanding of what we will be doing and what to expect.


6.1.1.

Manual Installation of Operating Systems


I
nstalling XP and Vista on our technician computer.




6.1.2.

WAIK


Creating manually unattended files

for unattended installation.


6.1.3.

Unattended Installations


Using unattended files for
unattended installation. This was done
on XP and Vista OS.


6.1.4.

WinPE


Installing WinPE on our USB HD and learning to work with the
WinPE command prompt. Later, we also had to
customize our
WinPE installation in order to support all the different
technologies.


6.1.5.

HTML


Learning to work with HTML from youtube videos.


6.1.6.

ImageX

Learning how to capture and deploy images with this tool (and the
sysprep tool).

6.1.7.

DiskPart


Learned how to wo
rk with this tool in order to properly format the
HD.


6.1.8.

VBScript

Studying this language and learning how to work with it alongside
HTML in order to create dynamic elements, calls utilizing WMI,
text and file manipulation etc.

6.1.9.

Quiet Application Installation

Using
different

tools to accomplish this goal (AutoIt scripts, msi
files, etc.)




6.2.

Basic Design

and Technology decisions
:


After completing our acquaintance with all the different
technologies, we started planning which features we want to


Partition


Calling ext utility

OS choice


Create HTML
input fields and
buttons


Passing variables
using VBScript

Definitions


Writing variables
to files

Applications


Calling scripting
elements (bat
files, WMI, etc.)


include and how
we will implement each feature. There are many
ways to accomplish each task, but we needed to make smart
decisions to avoid using the wrong technology for each feature. In
addition, we planned the "look and feel" of the GUI and how we
should implement each

feature.



Example:

Should we use
system variables

or parse our scripts?

Should we use AutoIt for quiet installations

or not
?




Figure
16

6.3.

Framework

Design and

Implementation:


The objective of this phase of the project was a
"preparation stage"
for the final product. We planned a basic, non
-
dynamic system in
which each phase of the GUI was a standalone application.

After
planning the functionality in each stage, we implemented (in
different HTA files) the different stages of t
he GUI. In each file,
we coded the basic functionality of the relevant stage.












GUI

WinPE

OS + App
DataBase

Scripting
Engines

HTML
application

Figure

17






Example:
In the "OS choice" phase we created fixed buttons (not
created dynamically) and learned how to read t
he input fields and
pass the inputs to
variables.


6.4.

Comprehensive Implementation:


During this phase of the project we
put together all the elements
needed in order to implement the final product. We soon learned
that only a small part of the framework was
reusable. For example,
creating dynamic elements (such as buttons) is very different from
creating fixed elements. We redesigned the code in one complete
file (our HTA) and added dynamic areas on our form that we clear
after each stage of GUI usage (after
pressing "next" we clear the
form and instantiate the next stage). In addition, we separated the
graphical code from the functionality using CSS. This changed
dramatically the "look and feel" of the GUI. Global variables
which contain data that is needed f
or different stages of the GUI
were added. We

added coordination

and synchronizati
on between
the different stages of the GUI. Also, a progress bar was added. In
summary, during this phase of the project we merged all the
different technologies while reusin
g some of the framework code.


Here is a screenshot of the complete GUI:





Figure
18




6.5.

Debug:


Th
is phase of the project was very time consuming. Some of the
challenges in implementing a USB Automatic Installation System
are that some of the Microsoft technologies are mainly used
internally by Microsoft and were not intended for massive public
users.
This leads to very poor documentation and so we needed to
rely on external documentation and a lot of "try and experiment".

Another difficulty in this project is that in order to debug our
system, we need to wait for a complete format and installation
befo
re we can see if our debug was successful.

The following were the most notable and time consuming bugs we
encountered:


6.1.1.

Capturing an image



Our captured images were not working correctly. Deploy
process was not working properly.
Sol
ution


Using sysprep
before capturing an image.


Progress
bar for user
indication

Graphics
implemented
by CSS

HTA body




6.1.2.

Drive query


One of the first procedures the GUI runs is a query to
determine which drive letter our USB receives. This letter
changes from computer to computer. We found that the
Windows Scripting Host (WSH) query was not work
ing on all
computers.
Solution


We implemented this query with
Windows Management Instrumentation (WMI).


6.1.3.

Unattended Installation Process



The first problem with this process was that it was not clear
when the process ends! The process seemed to terminat
e
prematurely. This was not properly documented at all.
Solution


After the computer reboots this process continues.

In order to make the process automatic we added a reboot
function. The second problem was that after completing the
installation, a lot of

files were unpacked on to our USB HD.
This included some files being overwritten, including the
"bootmgr" file in the root of the USB HD. This restrains our
system to be able to work only once, since it cannot be booted
again.
Solution


Using the proper
flags to initiate the
unattended installation process (
see figure X
)
.


6.1.4.

Partitioning Tool



We planned our system to work with an external tool in order
to partition the HD. This tool was not able to format the HD
when launched from WinPE.
Solution


We
designed our own
partitioning tool using the DiskPart utility (with script) and
WMI queries to show the current drives and partitions on the
computer.


6.1.5.

Rebooting WinPE




In order to reboot WinPE we can simply type "exit" at the
command prompt. But, when c
alling a batch file with the
"exit" command this only causes a new window to open and


the immediately close.
Solution


Using
"wpeutils" reboot
function.




6.1.6.

Applications



When installing multiple applications we encountered a
synchronization problem
. Calling multiple batch files in order
to install multiple applications caused contention.

Solution


Merge all the needed batch files into one batch file
(AllInstall.bat).