Recipe 2.4. Installing from an Unattended Installation
You want to use a script file to have a completely "hands-free" installation of Windows XP, particularly for use on multiple computers.
Using a graphical
Use Setup Manager to generate an unattended setup file based on your responses to different prompts.
On the Windows XP distribution CD, navigate through the
Select all files inside the new folder, and select Copy to Folder from the Edit menu.
Copy the files to a directory on your hard disk. You may need to create this directory using the Make New Folder button.
Inside the new folder, launch Setup Manager by double-clicking on
Once Setup Manager has started, you'll be prompted either to create a new answer file or to edit an existing one. Choose to create a new one, and click Next. Now, you're presented with several options, depending on the particular application for which your new answer file will be used. You can create a basic unattended setup answer file, one that can automate the mini-Setup program inside an installation that has been run through the SYSPREP utility (more on this later), or a file that will control installations started with RIS, or Remote Installation Services. Both of these are covered later in this chapter. For now, select to create a normal, basic unattended setup answer file, and click
The next screen prompts you to choose the operating system for which you're creating an unattended install -you can create files for all editions of Windows XP and all editions of Windows Server 2003 except Datacenter, too, so the Setup Manager utility is more useful than it might
appear. Choose to install Windows XP and click Next. At this point, you can now choose what level of "hands-off" you wish to achieve: a completely hands-on installation with customized defaults read from the answer file, a fully hands-off installation that is started from the command line and not finished until Windows XP is completely installed, and most options in between. Choose Fully Automated to get the full breadth of options that Setup Manager can manage, and click Next.
Here, Setup Manager offers to assist you in creating a distribution share on your network, a file share that contains an entire copy of the Windows distribution files for the purposes of kicking off network-based automated installation sequences. For our purposes, click on "No, this answer file will be used to install from a CD," since we just need to create an answer file, not generate an infrastructure for more complex rollouts. Click Next, accept the End-User License Agreement, and click Next once more. You have completed the wizard portion of the Setup Manager process, and the screen shown in Figure 2-3 is shown.
Figure 2-3. Setup Manager's detailed configuration screen
The remaining portion of Setup Manager involves customizing the many details of a Windows XP installation.
The first section, General Settings, allows you to enter your
and organization, and display settings like
depth and resolution, your time zone, and your Windows product key. Enter the appropriate values and click Next in each section.
The Computer Names screen appears. You have some options as far as assigning names to newly deployed computers: you can type in the names directly into Setup Manager, import
from a text file, or tell Setup to automatically generate them based on the values entered for the name and organization earlier in the process. Click Next to proceed.
Now, you need to generate an administrator password. Since you've
the fully automated type of answer file, the option for the user to provide a password is not available. Instead, you enter one yourself. Click Next to move on.
You're prompted on the next screen to select the appropriate networking
for these systems. The typical settings use DHCP to get an IP address and
file sharing capabilities. You can also select a static IP address. Click Next once you've configured the relevant options.
On the Workgroup or Domain page, choose whether to be a part of a workgroup or join an existing security domain. Also specify the names of either the workgroup or the domain to join. Click Next.
You're now in the Advanced Settings portion of Setup Manager, and the first screen is very, very useful: it allows you to determine exactly what
of Windows are installed on a machine. Now you can get rid of Games or not install IIS on all of your machines by default, a useful feature of the Windows installation program that Microsoft inexplicably removed first in Windows 2000 Professional and then in all later versions. Select the appropriate Windows components to include or not install, and click Next.
The Telephony Settings page appears. Enter your area code and outside dialing preferences, and then to proceed, click Next.
On the next page, adjust any regional settings, like keyboard, currency, time zone, and the like. Click Next, and again, specify your region-specific language settings. Click Next when you are finished.
The Browser and Shell Settings page appears. Using this feature, you can customize Internet Explorer's home page, security, and personalization settings, so that these are automatically set up during installation. Click Next once you've configured these options appropriately.
Specify the name of the folder where the Windows system files should reside. This is also known as the SYSTEMROOT for other purposes, like in the context of the Recovery Console. Click Next to continue.
The Install Printers screen appears. Here, you can specify the names of network printers that will be automatically configured and already available to the new installation. You can specify any number of network printers. This is a big win for all network administrators. Click Next once you've entered your list of printers.
The Run Once page allows you to specify commands and programs that will run after the first boot of the newly installed operating system -that is, just after it's finished. This is useful if you have batch files to run only once after a machine is installed. These settings are stored in the Windows Registry. Click Next.
The Additional Commands screen appears. These commands are executed at the end of Setup, but before the first restart. This feature is great if you're interested in installing the Recovery Console automatically after an installation is completed. To continue, click Next.
Finally, you'll be prompted to select a location for the answer file. Select one, click OK, and you have successfully created your answer file.
Before using your unattended installation script, you'll need to rename it from
. Refraining from doing so will result in a nonfunctional script.
You can see a sample SIF file, generated by Setup Manager, in the Discussion section of this recipe.
Using a command-line interface
To begin an unattended setup using a script, you first need to call
from the command line using the following,
your script is in
> Winnt32 /unattend:c:\deploy\winnt.sif
Another method is a bit less keyboard interactive but requires more manual labor: if you use the distribution CD-ROM to install Windows XP and you boot directly from it, Setup will look for a file on a floppy in the A drive named
. If it finds one, Setup will read the instructions from it; if it doesn't, then Setup will continue along a normal, user-interactive process.
Perhaps the simplest method of automating Windows XP deployment is to use unattended setup answer files. These files use a syntax not unlike that found in Windows 3.1's old INI files, providing answers for questions like computer name, your CD key, your name, where you live, and the like.
Here is a sample unattended setup file (known as an SIF file):
floppyless = "1"
msdosinitiated = "1"
OriSrc = "\%SERVERNAME%\RemInst\%INSTALLPATH%\%MACHINETYPE%"
OriTyp = "4"
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1
OsLoadOptions = "/noguiboot /fastdetect"
SetupSourceDevice = "\Device\LanmanRedirector\%SERVERNAME%\RemInst\%INSTALLPATH%"
OemPreinstall = yes
OemPnpDriversPath = \Drivers\Nic
DriverSigningPolicy = Ignore
FileSystem = LeaveAlone
ExtendOEMPartition = 0
TargetPath = \WINDOWS
OemSkipEula = yes
InstallFilesPath = "\%SERVERNAME%\RemInst\%INSTALLPATH%\%MACHINETYPE%"
LegacyNIC = 1
FullName = "%USERFIRSTNAME% %USERLASTNAME%"
OrgName = "%ORGNAME%"
ComputerName = %MACHINENAME%
ProductID = "ABCDE-12345-FGHIK-67890-LMNOP"
OemSkipWelcome = 1
OemSkipRegional = 1
TimeZone = %TIMEZONE%
AdminPassword = "*"
BitsPerPel = 24
XResolution = 1024
YResolution = 768
VRefresh = 60
JoinDomain = %MACHINEDOMAIN%
DoOldStyleDomainJoin = Yes
Repartition = Yes
UseWholeDisk = Yes
Description ="Windows XP with Service Pack 2"
Help ="Automatically installs Microsoft Windows XP Professional without prompting
the user for input."
LaunchFile = "%INSTALLPATH%\%MACHINETYPE%\templates\startrom.com"
Recipe 2.5 for cloning Windows XP installations, Recipe 2.6 for installing from Remote Installation Services, Recipe 2.17 for slipstreaming a service pack or
into a build, and MS KB 155197, "Unattended Setup Parameters" for information on each setting in the SIF file