'; window.popUpWin.document.write(zhtm); window.popUpWin.document.close(); // Johnny Jackson 4/28/98 } //--> Windows 98 Professional Reference -- Appendix D -- Installation Script


Windows 98 Professional Reference

Previous chapterContents


- D -
Installation Script


A Windows 98 installation script file is a Windows INF file. INF files typically provide instructions for installing devices or applications in Windows. An installation script is a special kind of INF file that provides instructions for installing Windows 98.

Generally, the best way to create an installation script is to use Batch98 (described in Chapter 2, "Installing Windows 98"). You may, however, occasionally need to modify an existing script or study a script for troubleshooting purposes. Your installation plan, for instance, may lend itself to a solution in which you create multiple scripts by modifying a template script directly rather than by using the Batch98 script-generating feature described in Chapter 2. This appendix provides some basic information on what you'll find in a

Windows 98 installation script. It is worth noting that, although Microsoft provides sample installation scripts and provides information on installation scripts through the Resource Kit and TechNet, officially, Microsoft "...does not encourage or support changes to INF files."


NOTE: You can gain insights on installation scripts by generating your own script by using Batch98 and then viewing or editing it with a standard text editor such as Notepad.


Just as an INI file does, an INF file groups configuration and installation information into predefined sections. Section titles are enclosed in square brackets. Installation script section titles and descriptions are shown in Table D.1. You'll learn more about each of these installation file sections later in this chapter.

Table D.1 Installation Script Section Titles

Section Description
[Setup] Settings relating to the actual setup process.
[System] System and device settings (e.g., monitor, mouse, language support).
[NameandOrg] Name and Organization settings for the PC; appear in the System Application General tab.
[Network] and network- Settings describing protocols, clients, and network services.
related sections  
[Optional Components] Settings describing which Windows 98 components to install.
[Printers] Settings defining the printer configuration for the PC.
[InstallLocationsMRU] UNC paths; lets you predefine a list of path options that you can choose during Setup.
[Strings] String key definitions--Setup expands a string enclosed in percent signs (%) to the value defined in this section. Strings keys can make the script easier to read and modify.
[Install] and related file- Settings that let you copy additional files to the new PC
installation sections along with the installation.

Each section of the installation script contains several options settings. You do not need to use all the possible settings in your installation script. The following sections describe some of the settings and show you how to use installation script settings to configure certain important features, as follows:

Automated Installation

If you are looking for the simplest possible automated setup, and you do not care about achieving a specialized configuration, your installation script can be very short. You need only tell Setup not to issue any prompts and provide settings for the few values for which Setup may not have a default. In the case of an upgrade, Setup can use the existing settings for almost all values. Microsoft provides the following script (minbatch.inf) as a minimal script for upgrades from previous versions of Windows:

[Setup]
Express=1
EBD=0
uninstall=0
vrc=1
[NameAndOrg]
Display=0
[Network]
Display=0

The [Setup] parameters are as follows:

The setting Display=0 in the [NameAndOrg] section tells Setup to use default name and organization information. In the case of an upgrade, the default would be the name and organization settings from the last installation. A value of Display=1 would cause Setup to prompt for the name and organization. Alternatively, you can enter the Name and Organization (Org) settings directly. The following example defines name and organization settings and tells Setup not to prompt:

[NameAndOrg]
Name="Zesty Higgins"
Org="NASA Spacefood Consortium"
Display=0

If you enter Display=1 along with specific Name and Org settings, Setup will prompt the user for a value and use the predefined settings as defaults.

The value Display=0 in the [Network] section tells Setup not to display network configuration dialog boxes during setup.

You'll learn more about the [Network] section later in this chapter. The [Setup] section in the following example is expanded to include some other useful parameters:

[Setup]
Express=1
EBD=0
unistall=0
vrc=1
InstallDir="c:\Win_dest"
InstallType=3
TimeZone="Central"
DevicePath=1

The additional [Setup] settings are as follows:

The [System] section provides some basic system settings. A [System] section is not required for automated setup (because Setup is capable of configuring system settings using autodetection and defaults); however, you may want to use a [System] section to configure the display resolution or a specific device for which autodetection is unreliable. The [System] section is also used to configure regional settings.

A typical [System] section might be as follows:

[System]
Displchar=16,640,480
Locale=L0409
SelectedKeyboard=KEYBOARD_00000409

The Locale and SelectKeyboard parameters are related to the regional settings, which are discussed in the following section. Displchar describes the display characteristics for the system. On a Windows 98 computer, you can find the display characteristic settings in the Settings tab of Control Panel's Display application. The Displchar format is as follows:

Displchar=color_depth,horiz_res,vert_res
color_depth: bits per pixel: 4 (for 16-color); 8 (for 256-color); 16 (for 16-bit �High Color); 24 (for 24-bit True color).
Horiz_res: horizontal (x) resolution.
Vert_res: vertical (y) resolution.

You can use the [System] section to specify other items such as display driver, monitor, mouse, and power management settings. (Typically, this isn't necessary; wherever possible, it is preferable to let Setup detect the hardware.)

Windows 98 maintains an INF directory (in the Windows directory) with an INF file for each type of device (KEYBOARD.INF, MONITOR.INF, MSMOUSE.INF, and so on). The setting for each device in the [System] section should reference the appropriate item in the INF file for the device (see Table D.2). Depending on the type of device, the [System] setting should refer to an INF section name or INF description.

Table D.2 INF Directory

Parameter Value Should Match INF File
Display INF description MSDISP.INF
Keyboard INF description KEYBOARD.INF
Locale INF section name LOCALE.INF
Machine INF section name MACHINE.INF
Monitor INF section name MONITOR.INF
Mouse INF section name MSMOUSE.INF
PenWindows INF section name PENWIN.INF
Power INF section name MACHINE.INF
SelectedKeyboard INF section name MULTILNG.INF
Tablet INF section name PENDRV.INF

If you find it necessary to specify the devices in the [System] section, you might want to consult the device vendor to determine the correct installation script settings. If you decide to go spelunking for a setting in the device INF (refer to Table D.2), note that, typically, the actual model names are listed in the [Strings] section and a string parameter then substitutes for the applicable section name or description. Typical devices callouts, for instance, may appear as follows:

[System]
Mouse="Standard Serial Mouse"
Monitor= "Panosonic C1381"

The term "Standard Serial Mouse" appears in long a list of mouse devices in the [Strings] section of the MSMOUSE.INF. An associated string is then used for the actual device description elsewhere in the file.

Regional Settings

The installation script's regional settings enable you to localize your Windows 98 installation for a particular language, time zone, and keyboard format. Sample regional settings are as follows:

[Setup]
TimeZone="Central"
[System]
Multilanguage=english
locale=L0409
SelectedKeyboard=KEYBOARD_00000409

The [System] settings refer to entries in the applicable INF files (refer to the preceding section). The easiest way to add regional settings to your installation script is to edit the script template regional.inf, included on the CD-ROM that comes with this book. Regional.inf lists the various options for time zone, keyboard, and locale settings.




NOTE: If you're performing an upgrade, Setup will carry over regional settings from the old installation.


Network Settings

You can use the installation script to define a complete network configuration. To specify a network configuration, you'll need a [Network] section, which defines general network settings, and one or more other network-related sections with values for specific protocol and service components specified in the [Network] section. Table D.3 describes some of the installation script's network-related sections. For information on configuring other Windows 98 clients, protocols, and services through the installation script, see the Windows 95 or Windows 98 Resource Kit.


NOTE: You don't have to provide a networking section with the installation script. For upgrades, Setup will retain the existing networking configuration if you don't supply networking information with the installation script. (Just make sure you run Setup from Windows 4 if you're performing a network installation without information in the script. If you run Setup from MS-DOS, Setup will install the default networking configuration, which could make the network inaccessible--including the network installation share.)


Table D.3 Network-related Installation Script Sections

Section Description
[Network] General networking information--computer name, security parameters, and so on
[MSTCP] TCP/IP parameters
[NWLink] Parameters relating to Windows 98's IPX/SPX-compatible protocol
[NWRedir] Client for NetWare Networks settings
[NWServer] File and Print Sharing for NetWare Networks settings
[Vredir] Client for Microsoft Networks settings
[Vserver] File and Print Sharing for Microsoft Networks settings

Listing D.1 is an example of a typical [Network] section with related sections. Many of the entries are self-explanatory if you have a basic understanding of Microsoft networking. See the comments in the listing for additional information. Table D.4 describes some additional settings that aren't included in the listing.

In general, settings that aren't required in Windows 98 aren't required in the installation script. For instance, because you aren't required to use DNS, you aren't required to provide the address for a DNS server. , however, that if you don't provide a DNS server, you should set the DNS parameter to 0 to disable DNS.

Listing D.1  Installation Script Network Section

[Network]
ComputerName="sonya"
Workgroup="BARKER"
Description="200 MHz Pentium"
Display=0               ;Do not prompt
PrimaryLogon=VREDIR     ;Microsoft Network is primary logon
Clients=VREDIR, NWREDIR ;Install Client for Microsoft
                        ;Networks and also Client for
                        ;NetWare Networks
Protocols=NETBEUI, NWLINK, NWNBLINK, MSTCP
                         ;Install NetBeui,
                    ;IPX/SPX-compatible (NWLink)
                       ;IPX/SPX NetBios support (NWNBLINK)
                     ;MSTCP (Microsoft TCP/IP)
                         ;
DefaultProtocol=MSTCP    ;TCP/IP is default
Services=VSERVER, NWSERVER   ;Install File and Print Sharing
                             ; Microsoft Networks and also
                             ;File and Print Sharing for
                             ; NetWare Networks
                             ;
Security=DOMAIN   ;Use user-level security validated through
                  ;NT domain. Other options: Security=
                  ;SHARE: share-level security;
                ;NWSERVER: user-level; use NetWare server;
               ;MSSERVER: user-level; use NT workstation.
               ;
PassThroughAgent="BARKER"  ;Domain name or name of server
                           ;providing security.
[NWLINK]
Frame_Type=4                ;Frame type.
NetBIOS=1                     ;Specifies NetBIOS/NWLink
[MSTCP]
LMHOSTS=1                        ;Use LMHOSTS; 0=do not use
LMHOSTPath="C:\WINDOWS\LMHOSTS" ;LMHOSTS path
DHCP=0                          ;Don't use DHCP; 1=use
DNS=1                           ;Use DNS; 1=don't use
WINS=Y                          ;Enable WINS resolution
DNSServers=160.99.89.17          ;DNS server(s)
Domain=barker                   ;DNS domain
Hostname=sonya
Gateways=145.122.99.109
IPAddress=145.122.131.145
IPMask=255.255.0.0
WINSServer1=145.122.16.150
[VREDIR]               ;Client for Microsoft Network settings
ValidatedLogon=1     ;Validate logon on domain(0=don't)
LogonDomain="BARKER" ;Name of logon domain
[VSERVER]         ;File and Print Sharing for Microsoft
               ; Networks settings
            ;
LMAnnounce=0   ; PC will not announce its presence to LAN
               ; MAN network. (1=will announce)
MaintainServerList=2  ;Browse master status
                   ;0=disabled (can't be browse master)
                  ;1=enabled  (is the browse master)
                   ;2=auto (can become browse master)
[NWREDIR]             ;Client for NetWare networks settings
FirstNetDrive=G
PreferredServer="NWServer"
ProcessLoginScript=1    ;Enables login script processing
                        ;under Client for NW Networks
[NWSERVER]              ;File and Print Sharing for NetWare
                        ;Networks settings
                        ;
BrowseMaster=0          ;Browse master status:
                        ;0=can't be a browse master
                        ;1=can be a browse master
                        ;2=preferred browse master
                        ;
Use_SAP                 ;Enables/Disables SAP browsing
                        ;0=disable SAP browsing
                        ;1=enable SAP browsing

Table D.4 Other [Network] and Network-related Settings

Section Entry Description
[Network] RemoveBinding Removes binding between two components (provides comma-separated list of component INF device IDs)
[MSTCP] DomainOrder Specifies search order for DNS domains (provides comma-separated list of DNS domains)
  ScopeID Specifies scope ID; used for NetBIOS over TCP/IP (see Chapter 25, "Windows 98 with TCP/IP")
  SecondaryWINS Address of secondary WINS server
[NWRedir] SearchMode Specifies NetWare search mode (default is 0)

Refer to Listing D.1 for basic network settings.

that, if you're performing a network installation, you must ensure that Setup has enough networking information to log on and connect to the installation share during the final installation phase. If you're upgrading and running Setup from within Windows 3.1 or Windows 95, Setup will retain the existing configuration. If you're performing a new install or running Setup from MS-DOS, or if you are changing the network configuration, you must provide Setup with the necessary logon information. If the installation share resides on an NT domain, specify a ComputerName and PassThroughAgent in the [Network] section and make sure the ValidatedLogon and LogonDomain settings in the [Vredir] section are correct. If the installation files are on a NetWare server, ensure that the NetWare-related settings in the [Network] and [NWRedir] sections (such as the PreferredServer) are correct.

If you are performing multiple network installations, it is a very good idea to start with a test installation to make sure the installation script and all other features of Setup function properly in your environment.


NOTE: If you have more than one network adapter (for example, both a network card and a dial-up adapter) and if you generated the installation script using Batch98, be wary of Batch98's multiple-adapter limitation (described in Chapter 2). Batch98's registry-scan Gather Now function bases its network settings on one of the two adapters, and it doesn't always choose the adapter you need to log on to the domain. (You can correct this problem within Batch98 by manually configuring Network Options.) Make sure the network settings in the installation script enable you to log on to a domain or server that will validate your access to the installation share.


You can use the [Network] section to specify a network adapter or disable the detection of network adapters. Microsoft, however, does not recommend overriding Setup's native detection by calling out an adapter configuration in the installation script. In most cases, it is better to leave network adapters out of the script and let Setup find and configure them automatically.

To specify a network adapter, provide the adapter's device ID (found in the adapter INF file) as a value for the NetCards entry in the [Network] section. You must then include a section with the adapter's device ID and include in that section any parameters from the [net_card.NDI] section of the adapter's INF file for which you do not want to use the specified default. Additional adapter-related settings include the following:

The adapter card settings may look something like this:

[Network]
Netcards=your_card      ;your_card=Device ID for your
                        ; network card as
                        ;specified in the INF file for the
                        ;adapter. Multiple entries should be
                        ;separated with commas.
IgnoreDetectedNetCards=1  ;ignore cards detected by Setup.
ValidateNetCardResources=1 ;Do not display wizard to resolve
                           ; resource conflicts
[your_card]
...

Settings will vary depending on adapter. See the [your_card.NDI] section of the adapter's INF file.

Optional Components

The [OptionalComponents] section of the installation script tells Setup which optional Windows 98 components to install on the system. For a discussion of Windows 98 optional components, see Chapter 1.

The [OptionalComponents] section is not required. You can assign a standard package of components using the InstallType setting in the [Setup] section (described earlier in this chapter). The default InstallType value is 1 (Typical).

The format for the [OptionalComponents] section is as follows:

 [OptionalComponents]
"Accessibility Options"=0
"Briefcase"=0
"Calculator"=1

A value of 1 tells Setup to install the optional component. A value of 0 tells Setup not to install the component. If you don't include an entry for the optional component (and if the component isn't part of the active InstallType package), Setup will not install the component.

Batch98 provides entries for all optional components and sets the value for disabled components to 0.

Printers

The [Printers] section lets Setup configure printers while it performs the installation. You can specify either local printers or network printers. The format for an entry in the [Printers] section is as follows:

"printer_name"="driver",port

Following is an example of a [Printers] section:

 [Printers]
"downstairs_print"="HP DeskJet600",LPT1
"upstatirs_print"="HP DeskJet500",\\natasha\natprint

Setup's MRU List'

The MRU (Most Recently Used) list is a prominent feature of the Windows environment. The MRU list is the list you get when you click on the arrow to the right of a text box: It displays the most recent entries that have been typed into the box. You can use the installation script to preconfigure an MRU list that will provide UNC path options during Setup.

The MRU list option is useful if you are setting up several machines that are mostly identical but that, for some reason, require you to reference different network locations during Setup. For instance, you may need to configure two otherwise identical machines to receive user-level security from different NT Workstation machines. Or, the two machines may need to access different printers. In these cases, you may want to run the same installation script on both machines (for the sake of simplicity) and let the various network path options appear in the MRU list so that you can easily select them during the installation.

Of course, if you choose to perform a totally automated installation (by disabling all user prompts), it won't matter what you choose to put in the MRU list--you still won't have the chance to answer any screen prompts. This option is only for cases in which you expect to perform at least part of the installation interactively.


NOTE: An earlier section, "Automated Installation," describes how you can limit the interactive input by separately disabling setup-related prompts, name/organization prompts, and network-related prompts.


If you have slightly different configurations for two machines and you want to perform a fully automated installation, an alternative to this MRU-list option is to manually make the necessary modifications to the installation script and save the script under two different names to run on the different machines.

The format for the [InstallLocationsMRU] section is as follows:

[InstallLocationsMRU]
\\Pierre\Install
\\Natasha\CDRom
\\PrinceAndre\Printer1

Installing New Files, Changing Configuration Files, and Modifying the Registry

The [Install] section provides some important advanced features that extend the capabilities of an installation script. Specifically, the [Install] section enables you to perform the following tasks:

The ability to modify the Registry directly is at the heart of the [Install] section's subtlety and power. Like any other feature that lets you operate freely within the Registry, this feature requires deliberation and care. Microsoft offers some templates and guidelines for how to use the [Install] section to accomplish specific tasks--you'll learn more about those tasks later in this section.

Each entry in the [Install] section takes as a value a comma-delimited list of section headings referring to other sections that contain pertinent instructions. You'll see an example of the [Install] and install-related sections later in this chapter. The parameters of the [Install] section are as follows:


NOTE: Remember that the role of the Windows configuration files (autoexec.bat, config.sys, and the inis) has narrowed considerably with Windows 95 and 98. The primary use of these files is to support legacy applications. See Chapter 32, "Windows 98 Configuration Files," for more information about Windows configuration files.


The number of possible scenarios for employing the features of the [Install] section is as limitless as the Registry itself, but, for practical matters, the principal reasons for adding this complexity to the installation script are as follows:

Batch98, described earlier in this chapter, lets you add a Registry file and/or a System Policy file and automatically updates the [Install] section of the installation script accordingly. If possible, it is always easier to use a Batch98 script or a template script rather than trying to configure Registry settings yourself.

Microsoft's INF template userprof.inf shows how to enable Group Policies, User Profiles, and Remote Registry Administration. Listing D.2 is a composite of userprof.inf's [Install], a Batch98 [Install], and other Microsoft [Install] sample information. The code in Listing D.2 performs the following tasks:


NOTE: A .reg Registry file does not have to contain a complete copy of the Registry. You can export a single tree or subtree to a Registry file (see Chapter 10, "Mastering the Windows 98 Registry"). You can thus selectively copy only part of the Registry and handle the rest of the configuration through auto-detection, script settings, and defaults.


Listing D.2  Sample [Install] and Install-related Sections

;  You must also make sure that the related support files
;  (REGSERV.EXE, WINREG.DLL, GROUPPOL.INF, GROUPPOL.DLL) have been
;  copied from the Windows 95 compact disc to the server that contains
;  the Windows 95 Source files.
;  If you use INF Installer to set up the source files for group policies
;  with the Windows 95 source files on the network, you can
;  install group policies by just adding Services=grouppol in the [Network]     		�section.
[NETWORK]
Services=remotereg
;  The following entries enable user profiles,
;  remote administration of the Registry, and group policies
[INSTALL]
Addreg=User.Profiles.Reg, Group.Policies.Reg, Remote.Admin, RegistrySettings
Copyfiles=Group.Policies.Copy, Spacefood.Inc
[USER.PROFILES.REG]
HKLM,Network\Logon,UserProfiles,1,1
;  In the following example, %Server_Username% must be defined in a [Strings] 		�section.
;  The Registry location is defined by the value �HKLM,"Security\Access\Admin\Remote".
[REMOTE.ADMIN]
HKLM,"Security\Access\Admin\Remote",%Server_Username%,1,ff,00
[GROUP.POLICIES.REG]
HKLM,Network\Logon,PolicyHandler,,"GROUPPOL.DLL,ProcessPolicies"
HKLM,System\CurrentControlSet\Services\MSNP32\NetworkProvider,GroupFcn,, �"GROUPPOL.DLL,NTGetUserGroups"
HKLM,System\CurrentControlSet\Services\NWNP32\NetworkProvider,GroupFcn,, �"GROUPPOL.DLL,NWGetUserGroups"
[GROUP.POLICIES.COPY]
grouppol.dll
[DESTINATIONDIRS]
Group.Policies.Copy=11    ; LDID_SYS
[RegistrySettings]
HKLM,%KEY_RUNONCE%,BatchReg1,,"%25%\regedit.exe /s %1%\reg1.reg"
;  Notice that under the [Strings] section, the percentage sign is NOT used.
;  Remove ";" and type the name for the server or domain containing group policies.
[Sapcefood.inc]
\\Pierre\pierreC\c:\spacefood\logo.bmp
\\Pierre\pierreC\c:\spacefood\info.hlp
\\Pierre\pierreC\c:\spacefood\expenses.xls
\\Pierre\pierreC\c:\spacefood\jokes.ha
;[STRINGS]
;Server_Username = "Server\Name"
KEY_RUNONCE="SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"

Previous chapterContents

Copyright, Macmillan Computer Publishing. All rights reserved.