Computer Services
Stanton/Wilmington Campus
XP documentation and procedures
ainstall.kix
Background
Ainstall (app install) was historically used by our NT unattended
install procedure. It got ugly pretty quickly. It would take an arg on
the command like, parsed from a config file, and call a label inside
the batch file to do a lot of stuff. Sysdiffs were all in the same dir
and supporting files were scattered all over.
Design
Pat, who often gets to clean up my mistakes and/or make my ideas
far more elegant, has suggested we make a general installation share
point and a separate subdir for each install option and have NT and XP
share the same install subdir. If needed, each can detect the
installed OS and proceed differently (via applying different sysdiffs
or scripts). Our "ainstall" program could then be a lot simpler, like
almost just taking an arg and CDing into the proper install directory
and calling a standard install.bat file inside each one.
Example:
\\server\install\apps\foobar
Under foobar could be a subdir for winnt and winxp for OS specific
packages and in the top of foobar would be an install.bat file that
figures out what to do as appropriate.
In addition, I'd like to add error checking to the install.
Make our own HKLM reg key and scribble installed packages into
there. ainstall would know the package option name from its arg -- like
netscape), it would call the install.kix file in the package name's
subdir, that package should do some sort of check to ensure everything
got installed, and if so, scribble the package name and version into a
regkey. If it didn't install, it should attempt some sort of error
recovery (like reboot and try again for example...)
reg structure...
HKLM
\ Software
\ DTCC
\ Packages
\ PackageA
\ Version
Date
Time
Login Info
\ ainstall
\ returnval
bootcount
fresh
final
unattended
Each ainstall.kix script should have a list of other package
dependencies in it and return a status string via the key:
HKLM\Software\DTCC\ainstall\returnval
returnval can be one of
- ok - Package already installed and tests ok
- done - Package installed OK
- reboot - Package installed OK, perform reboot before installing other packages
- fresh - Package requests it be first to be installed after a reboot, not installed, schedule a reboot
- fail - Package failed to install for some reason.
ainstall will not increment pkgcount or sweepcount and increment skipcount.
Hopefully a reboot will fix the problem and it will install next time.
- dependency - Name of package that must be installed before this one. Install not done. Note that install.kix may have several
dependencies listed. It checks the install status of each one and then
exits with this regkey set to first package it fines. Next sweep will
invoke it again and it can recheck and return another dependency if
appropriate.
With this in place, hopefully, we can just list packages needing to
be installed in any order and list the rules in each install.kix file
and the code should be smart enough to figure out what it needs to do. To do this, ainstall needs to maintain status info in reg keys or variables it
can check. They are:
- pkgcount - regval - Count of packages installed ok during this boot session
- depcount - array variable - list of packages skipped due to
a dependency failure. Each time we try to install a dependency, we check
to see if it's already listed in this array. If so, we've detected a
dependency loop and need to fail.
- sweepcount - variable - Number of times packages installed
during this sweep. If we hit end of list and this value is above zero,
we start scanning list from top again hoping to pick up a few more before
having to reboot. If we get to end of list and sweepcount is zero and
skipcount is not zero, we do a reboot. If we get to end of list and
sweepcount is zero and skipcount is zero, we set the final regkey to
1 and reboot
- skipcount - variable - number of packages skipped during this
boot session. If this is above zero at end of processing list, we increment
loopcount and start the list from the top
- final - regval - If not zero, then this is final boot. Do
any clean up, prevent further reboots, set default domain winlogon key
to DTCC, autoadminlogoncount to zero, reboot.
- fresh - regval - A package requested to be installed first
in the next reboot. Park that package's name here. On next reboot,
check this key. Note that this only holds one value even though during
a sweep there may be multiple packages that request to be done
fresh. Doesn't matter, as long as one makes the grade at reboot
time. They can overwrite or honor if a value exists. I don't think it
makes a difference. It'll all sort itself out.
- bootcount - regval - A number of boots where no packages
were installed. This is a failsafe to prevent infinite rebooting. If
this value hits a set max times, we give up and list packages that
failed to install and hold the install at that point.
- unattended - regval - set to true during an unattended install.
At end of install (final phase) it should be removed. This key flags
ainstall.kix that it is not invoked by a user. It is also checked
when ainstall.kix determines its job is done. If true, it will do the
final cleanups. If done by an end-user, it will just reboot the machine
and not muck with the autologon key values.
package install.kix responsibilities
- Ensure that it doesn't exit before setting returnval. Best to blank
out the key first just in case. The key will contain the previous
packages value which we don't want to return by mistake.
- Know how to check if other packages it depends on exist and what to do if they don't (return the package needed in returnval)
- If it wants to be first install, know how to check pkgcount regkey to
see if it is zero or not and if not zero, return fresh value
- If it requires a reboot after install (where no other packages should
be installed after it), it should return reboot if it installs ok.
ainstall responsibilities
The ainstall.kix program itself will be invoked either by the
unattended install (where it groks a list of packages out of a file)
or by a sysop doing a single package install (where it uses a package
list of just one.) This begs the question of what to do if a sysop
invokes a package install with dependencies which aren't already
installed. In this case, it'd be nice if ainstall would handle the
dependencies as well and do the right thing.
So, basically, ainstall.cmd would live in the root of the install
share and be invokable via sysop and ainstall.kix would live in the
apps directory and be invoked only by the unattended logon process or
via ainstall.cmd from the root.
So ainstall.kix needs to handle calling package install scripts
in each directory, managing their return values, knowing when to reboot,
and knowing when to finish up and clean up.
Main XP Unattended Install Doc Page
Last page update: 02 May 2002
Official URL for this
page: http://www.dtcc.edu/cs/admin/xp/ainstall/
Page Maintained by: Ken Weaverling