If you're going to install Windows NT on more than a few machines, you've got a lot of work ahead of you. Admittedly, NT is easier to install than some other operating systems. Still, the complete installation process represents time you could spend elsewhere. Even with the fast CD-ROMs on the market and the convenience of floppy-less or network installations, overseeing an installation takes time, and time is valuable.
Now NT 4.0 lets you write a script not only to instruct NT how to perform an installation but to customize the installation for each user. Although NT 3.51 supported answer files, which let you run installations from scripts, answer files weren't a perfect solution because you had to create a new answer file for every change in the installation (such as the user's name). NT 4.0 adds a way to customize the answer files with uniqueness database files (UDFs), which apply to the graphical portion of NT's setup. You can create an answer file for a particular hardware platform and then tack a UDF onto the answer file to customize the installation for particular users.
NT supports two methods of unattended installations: Setup Manager and, for server-driven installations, Systems Management Server (SMS). This article will describe Setup Manager.
General and Specific Scripts
Answer files automate the entire installation process, supplying parameters for all aspects of your installation, from the type of network card to the colors on your desktop. UDFs apply to only the graphical portion of setup, which contains user preferences and the machine's role in the network. I'll explain exactly how answer files and UDFs interlock, but the rule of thumb is that if a parameter value exists in both the answer file and the UDF, the value in the UDF controls. Otherwise, the value in the answer file controls. In other words, because answer files apply to both the text-based and the graphical portions of setup, you can create a UDF that applies to only certain portions of the GUI-based setup and let the values in the answer file control the rest of the time.
Both answer files and UDFs are combinations of sections, keys, and values that resemble Windows 3.x .ini files. Listing 1 shows a sample installation answer file. In Callout A in Listing 1, \[Unattended\] is the name of the section, the entries such as NtUpgrade and TargetPath are keys, and the words no or manual are values. Just as you can't specify options during an installation until Setup asks for them, you must put keys and their values in the proper section for them to take effect.
The sample installation answer file in Listing 1 resides in the \i386 directory of your NT Server or NT Workstation installation (unattend.txt). The answer file contains the following sections:
\[Unattended\]: information about how you want Setup Manager to identify hardware and install the hardware drivers and whether the installation is new or an upgrade
\[UserData\]: fields for the name of the user, the computer, and the organization
\[GuiUnattended\]: information for the time zone settings
\[Display\]: the display settings, including whether to configure them interactively
\[Network\]: setting to install NT as network-aware
\[ProtocolsSection\]: TCP/IP by default, but you can choose other protocols
\[TCParameters\]: Dynamic Host Configuration Protocol (DHCP) by default
Creating an Answer File
Although you can edit unattend.txt in your favorite text editor, the simplest way to create an answer file is to use Setup Manager. You can find Setup Manager within the support\deptools subdirectory of your NT Workstation (not Server) installation. The exact location depends on your NT platform: Intel users will find the Setup Manager in the \i386 subdirectory of \deptools. Or the Microsoft Windows NT Server Resource Kit for NT 4.0 has a Server version of setupmgr.exe that includes some options not in the NT Workstation Setup Manager. The two tools are similar in function--the one in the resource kit just rearranges a few options and has some extras. (Before you configure an installation script with either version of the Setup Manager, run some manual installations to get a feel for the process.)
When you open the Setup Manager, you see the dialog box shown in Screen 1. Simply enter the identification information, then click the General Setup button.
As you can see in Screen 2, the General Setup Options are more complicated. (Note that the names on the tabs aren't exactly the same as the section names in the text files.) Complete this dialog box and its tabs according to your preferences.
The General tab contains the settings that instruct NT Setup when to just detect the hardware on the machine, as it does during a supervised installation; when to upgrade the current installation (remember that you can't upgrade a Windows 95 installation to NT); and when and how to run certain programs during installation. If you want to fully automate the installation, be sure to leave the Confirm Hardware check box blank.
The Computer Role settings define whether this NT machine will be a server or workstation. Type the domain or workgroup name exactly--correct identification of the domain or workgroup is crucial in an NT installation. The Computer Role tab has no drop-down menus for you to choose from.
The System Directory tab asks for the name of the NT installation directory. If you keep the default, an asterisk will mark this entry in the text version of the answer file. If you are upgrading, be sure to supply the proper name of the directory; for unattended installations, choose either the default location or Define a location now. If you choose Define a location now, the installation will wait for the user to pick a destination directory.
The Display Settings tab corresponds closely with the \[Display\] section in the text file. Although the point of an unattended installation is to avoid babysitting the process, you may want to select the check box for configuring the graphics settings as Logon. This way, you avoid installing settings that the monitor or the video card can't handle. If you choose the simplest options and set up the display for 640*480 and 16 colors, you should be all right. If you're not sure what to enter in this dialog box, type 0 in each space or leave the space blank. Then NT Setup will install the default settings (640*480, 60Hz refresh rate, and 256 colors), as long as the hardware supports that mode.
The only issue to consider on the Time Zone tab is the destination of the installation. If you perform the installation in one time zone for a user in another zone, use the destination time zone. You can easily modify the time zone later.
When you've made your choices, save the answer file to a directory other than the default, because you may not think to look for answer files in the \i386 subdirectory of \deptools. If you open the file in a text editor, you'll find the entries relating to each of these options in the sections shown in Table 1. Now let's look at the other two buttons shown in Screen 1: Networking and Advanced.
Screen 3 shows the Networking Options dialog box. Select Attended Network Installation to supervise the installation of networking. If you attend the network installation, you don't have to configure settings on the Adapters tab. If you check Auto Detect Adapter(s), you can choose whether you want NT Setup to find and install your network adapter cards, install the cards with your help, or just find the network adapter cards and let you install them. Select the Install Modem check box if you want to configure a modem (and then complete the settings on the Modem tab).
The Adapters, Protocols, and Services tabs let you define sections for installing these items. From the Services tab, shown in Screen 4, you can configure only network services: Simple Network Management Protocol (SNMP), Remote Access Service (RAS), and Client Services for NetWare. You can't configure non-networking services here.
Remember the names you give the sections that describe adapters, protocols, and services. You must copy them exactly if you create a UDF to override some settings in the answer file. To add a service, adapter, or protocol to the list, select the appropriate tab and click Add. For example, to install RAS, select the Services tab, and click Add to add the section. Then select the new section name and click the Add button below the List of Services list box to choose the RAS service. (The NT Workstation Setup Manager does not have a default name for the Protocols, Services, or Adapters sections, but Microsoft Windows NT Server Resource Kit does. If you're using the resource kit, consider keeping the default section names so that you can remember them more easily.)
To add a section describing a protocol's parameters, click Parameters. (Even protocols such as NetBEUI that don't take any parameters must have a Parameters section in the answer file, but the section will be blank.)
Use the Modem tab to install a modem for use with NT. Be careful to select the correct communications port to use with the modem--you don't want to select the communications port a serial mouse uses. By selecting Modem Parameters, you add a Modem Parameters section to the answer file. If you don't configure any settings in the Modem Parameters section, NT Setup will use the default settings. The settings defined in the Networking Options part of the Setup Manager are either in the Network section of the answer file or in user-defined sections.
Clicking the Advanced button, shown in Screen 1, brings you to the dialog box shown in Screen 5. Use this dialog box to add the final touches to the NT installation: input device drivers, file system, mass storage devices, and other options that you set in text-mode setup. You don't have to configure many of these options for most installations. If you don't adjust the values on these tabs, Setup Manager will use the defaults (autodetection, in the case of the hardware). Adjust them only if necessary. Setup restricts these settings to your installation answer files because they're all set in text mode.
Creating a UDF
UDFs are similar to answer files, but they have an additional section, UniqueIds, and no sections that apply to only text mode. UniqueIds contains the identifiers for each unique installation you specify in the UDF. For example, you use an answer file called wkstation.txt to create domain workstations. Workstations don't have identical installations, so you create a UDF for the graphical settings unique to each installation type, such as the domain name, display type, protocols to install, and the like. This UDF can contain the specifics of more than one type of installation, but a certain text string, a unique ID, identifies each set of specifics. In other words, you don't need a separate UDF for each unique installation. You create a UDF just as you create an answer file, except you must add the UniqueIds section by hand in a text editor; Setup Manager doesn't include a tab to create these identifiers.
The unique IDs are the keys in the UniqueIds section; the values of those keys are the sections in the UDF that replace the answer file values for those identified installations. Therefore, the values in the following UniqueIds section
\[UniqueIds\]erpent = UserData,GuiUnattended
froggy = UserData,Network
turtle = UserData,Modem
mean that the UDF includes three specific installation settings, serpent, froggy, and turtle (this company organizes wildlife preserves). All three settings will use the information in the answer file wkstation.txt, but sections of the same respective names in the UDF will replace the UserData and GuiUnattended sections in serpent; the UserData and Network sections in froggy; and the User-Data and Modem sections in turtle.
Be careful to name the sections in the UDF identically to the sections specified in the answer file. If the two sections don't have the same name, they conflict, and the UDF's parameters won't replace the answer file's parameters.
When used with answer files, UDFs usually have precedence, as these examples illustrate:
- If a key has a value in the answer file but doesn't appear in the UDF, the value in the answer file controls.
- If a key has a value in both the UDF and the answer file, the value in the UDF controls.
- If a key has a value in the answer file and appears but has no value in the UDF, the default value for the key in the UDF controls (i.e., the answer file does not control). When there is no default, the installation will prompt the user for the information.
- If a section or key appears in the UDF but not in the answer file, Setup creates that section in the answer file.
You cannot define all settings (most noticeably for hardware) in the UDF, but you must include all settings in the answer file. If a section appears in the UniqueIds section of the answer file but does not exist in the UDF, Setup will prompt the user for a floppy containing the UDF.
UDFs can apply only to the options set during graphical mode setup, not text setup, so applying UDF values to the following sections won't affect the installation:
Using the Installation Files You've Created
Once you create the installation files for unattended installations, you put them into play with the winnt or winnt32 command. To specify an answer file only, use the following syntax:
where <answer_file> is the name and path of the answer file you created. To also include a UDF in the installation, type the winnt32 command:
winnt32 /u:<answer_file> /udf:<uniqueness_database_file>
where <uniqueness_database_file> is the name and path of the UDF. If you don't specify a path, Setup prompts you for a floppy with a UDF named $unique$.udf on it. If you select Cancel when you're prompted for the UDF, Setup uses the values in the answer file.
NT 4.0 makes unattended installations even easier than they were in NT 3.51 by letting you vary the setting for graphical-mode setup. For system administrators with lots to do and not enough time, these enhanced installation tools can be a lifesaver.