Individualize OSChooser options
As a consultant, I install Windows 2000 so frequentlyeither on my own systems or on my clients' systemsthat I now see the wizard panels in my sleep. I think I've manually installed Win2K one too many times. So, last Christmas, I asked Santa to deliver a completely automated voice-activated program for installing Win2K from start to finish, complete with all the applications and service packs I need. I figured I was going a bit overboard by asking for voice activation, but I did expect more than the lump of coal I got in my stocking! So what does a disgruntled engineer do when he doesn't get the program he wants for Christmas? He builds it himself.
I began by considering the options for deploying systems. I rated how important ease of use, flexibility, and installation speed were to me. I placed more emphasis on ease of use and flexibility than on installation speed. (Laptop computer manufacturers, for example, might find speed more important, given the number of systems they deploy. But I don't mind if an installation takes 2 hours to complete, as long as I have to be at the keyboard for only the first 5 minutes.)
I also took into account that I could be installing Win2K Professional on any number of systems, from any number of hardware manufacturers, and that the hardware could be significantly different in each case. This factor limited the possibilities for disk-cloning methods.
Microsoft Remote Installation Services (RIS) met my criteria; it's a great tool for deploying Win2K Pro. RIS's out-of-the-box capabilities are impressive. However, you don't have to stop at out-of-the-box functionality. You can build a better mousetrap; you can tweak RIS for your environment; you can push the envelope of automated installations.
RIS 101
Let's start with a brief review of the tool. RIS lets you boot computers over the network, with or without the aid of a boot disk, and perform automated installations of Win2K Pro. (The computers can have another OS already installed or a completely blank hard disk.) The power of RIS is that it easily boots into the environment and begins a Win2K Pro installation quickly.
I won't cover the details of how RIS accomplishes its purpose. RIS is simply a fancy method of launching a typical Win2K Pro unattended installation. If you're familiar with Windows NT-based unattended installations and files such as unattend.txt, you might be surprised to learn that RIS uses the same methods to automate installations. For additional information about the nuts and bolts of RIS, see Sean Daily, "Understanding Remote Installation Services," February 2001.
RIS Advantages and Disadvantages
The beauty of RIS is that the tool is simple to use after you set it up. You can start using RIS to automatically install Win2K Pro within 30 minutes of taking the tool out of the box. However, the downside is that in creating RIS's standard configuration, Microsoft made specific assumptions about options you might want when installing Win2K Pro. Therefore, the standard RIS environment leaves little room for customization. The only real flexibility you have with the standard configuration is the option to choose how to define machine names.
The standard RIS configuration might work well for some installations, but you need more flexibility for complex environments. What if you want to specify a hard-coded IP address for each machine instead of assuming DHCP-based addresses? What if you want to customize the components RIS installs on some systems? What if you want to add Microsoft Office, the latest service pack, or other applications to your system after you complete the Win2K setup? With enough time (and patience), you can work around these shortcomings and develop advanced installation techniques.
The OSChooser Foundation
In Mastering Windows 2000 Server, 2nd edition (Sybex, 2000), Mark Minasi documents a neat RIS trick: You can customize the screens that RIS presents. For example, I modified the \RemoteInstall\OsChooser\welcome.osc (OSChooser is RIS's Client Installation Wizard) file on my RIS server so that instead of displaying the typical Welcome to the Client Installation Wizard screen at the start of a RIS-based installation, the screen would display Welcome to Doug's Super Terrific Automated Win2K Installation Gizmo.
Because .osc files are stripped-down versions of HTML designed for character-based (i.e., non-GUI) displays, a quick edit of a file in Notepad lets my RIS server flash my personalized welcome to whoever wants to install Win2K Pro. Although this ability to customize the welcome screen can be a nice ego trip, it's not functional. With or without the customized introduction screen, RIS simply continues its usual installation process, making all sorts of assumptions about how you'd like to install Win2K Pro.
Recently, two brilliant NT engineers and I were working on a RIS project, and we stumbled across the real power behind OSChooser screens: the INPUT command. (As far as I can determine, the Win2K Server Help files don't document this command; we found the command in the Microsoft Windows 2000 Server Resource Kit Help files.) You can use the INPUT tag to create fields within OSChooser screens. These fields can collect information from the person performing the installation. With the right amount of file tweaking, you can configure the Win2K Pro installation process to use the information that the INPUT tag lets RIS collect.
This key point bears repeating: You can ditch the standard Microsoft Client Installation Wizard screens and make your own screens that ask the installing user any sort of question (e.g., Do you want to install Service Pack 1?). The screens then capture the user's response. When you have the response, you can use it to customize the installation routine. Figure 1 diagrams this process.
To better understand the INPUT capability, you need to understand unattended installation files, environment variables, and template files, and how they work together in an OS installation. Let's look at an example of how Microsoft automatically sets the time zone for a system in a RIS installation.
When you use RIS to install Win2K Pro, you don't have to tell your system what time zone the system is in. So how does RIS know which time zone to choose? It's quite simple. When a user boots into the RIS environment, OSChooser presents a series of screens to collect information from the user.
After the user moves through the last OSChooser screen, the Win2K installation process begins. However, while the user was working through the wizard's screens, OSChooser was secretly populating certain environment variables. The time zone is one of those variables. By default, OSChooser queries the RIS server for the time zone the server is in, then, on the target machine, the wizard populates the %timezone% environment variable with the same value.
To pass an environment variable in memory to the target computer, RIS uses an unattended installation file known as a template. If you're familiar with unattended installations, you'll see that a RIS template file (typically ristndrd.sif) looks like a standard unattended installation file, except that in the [GuiUnattended] section, the file refers to the time zone environment variable and not to an absolute value. For example, the prepopulated ristndrd.sif file on a standard RIS server would contain the following lines:
[GuiUnattended]
TimeZone = %timezone%
Before OSChooser starts the Win2K installation process, OSChooser writes each line of the template file to the target computer, converting each environment variable reference to its actual value. For example, OSChooser would rewrite the ristndrd.sif file lines above with the time zone's value:
[GuiUnattended]
TimeZone = 04
The unattended installation files guide the Win2K installation process. The Win2K installation automatically knows what time zone it should use from the relevant lines of the ristndrd.sif unattended installation file. Thus, installing users never need to select their time zone; OSChooser simply passes the correct value to the Win2K installation process by means of a template file and an environment variable.