Previous | Next

[Install] Section

Syntax

[install-section-name]
Copyfiles=file-list-section[,file-list-section]...
LogConfig=log-config-section-name
Renfiles=file-list-section[,file-list-section]...

Delfiles=file-list-section[,file-list-section]...
UpdateInis=update-ini-section[,update-ini-section]...
UpdateIniFields=update-inifields-section[,update-inifields-section]...
AddReg=add-registry-section[,add-registry-section]...
DelReg=del-registry-section[,del-registry-section]...
Ini2Reg=ini-to-registry-section[,ini-to-registry-section]...
UpdateCfgSys=update-config-section
UpdateAutoBat=update-autoexec-section

The [Install] section identifies the additional sections in the INF file that contain descriptions of the device and instructions for installing files and information needed by the device drivers. The install-section-name must be defined in a [Manufacturer Name] section and consist of printable characters.

Not all entries in this section are needed or required. If an entry is given, it must specify the name of a section. (An exception to this is the CopyFiles entry.) More than one name can be given for each entry, but each additional name must be preceded by a comma. The exact format and meaning of the corresponding entry depends on the entry type and is described in later sections. Each [Install] section should include the creation date of the driver set.

This example shows a typical [Install] section:

[MyApplication] 
Copyfiles=MyAppWinFiles, MyAppSysFiles, @SRSutil.exe 
AddReg=MyAppRegEntries

Note that by renaming the [MyApplication] section to [DefaultInstall] (in the above example), this Install section would be executed—when the "Install" verb is selected by right-clicking the INF file.

The CopyFiles entry provides a special notation which will allow a single file to be copied directly from the copy line. An individual file can be copied by prefixing the file name with an @ symbol. The destination for any file copied using this notation will be the DefaultDestDir as defined in the DestinationDirs section. The following example shows how to copy individual files:

CopyFiles=FileSection1,@myfile.txt,@anotherfile.txt,LastSectionName

[Logical Configuration] Sections

Syntax

[log-config-section-name]
ConfigPriority = priority-value
MemConfig = mem-range-list
I/OConfig = io-range-list
IRQConfig = irq-list
DMAConfig = dma-list

A [Logical Configuration] section defines configuration details, such as IRQs, memory ranges, I/O ports, and DMA channels. An INF file can contain any number of [Logical Configuration] sections, as many as are needed to describe the device dependencies. However, each section must contain complete details for installing a device. The log-config-section-name must be defined by the LogConfig entry in the [Install] section.

Not all entries are needed or required. If an entry is given, it must be given appropriate values as described in the subsequent sections.

Each entry can specify more than one resource. However, during installation only one resource from an entry is used. If a device needs multiple resources of the same type, multiple entries must be given. For example, to ensure two IRQs for a device, two IRQConfig entries must be given. If a device does not require an IRQ, no IRQConfig entry should be given. For each entry, Setup builds binary logical configuration records and adds these to the driver section of the registry.

[Update AutoExec] Section

Syntax

[update-autoexec-section]
CmdDelete=
command-name
CmdAdd=command-name[,command-parameters]
UnSet=env-var-name
PreFixPath=ldid[,ldid]
RemOldPath=ldid[,ldid]
TmpDir=ldid[,subdir]

The [Update AutoExec] section provides commands to manipulate lines in the Autoexec.bat file. The update-autoexec-section name must appear in an UpdateAutoBat entry in the [Install] section.

Not all entries are needed or required. The section can contain as many CmdAdd, CmdDelete, and UnSet entries as needed, but only one entry for PreFixPath, RemOldPath, and TmpDir can be used per file.

Setup processes all CmdDelete entries before any CmdAdd entries.

For more information about LDID values, see "[Update INI] Section" later in this appendix.

[Update ConfigSys] Section

Syntax

[update-config-section]
Buffers=
legal-dos-buffer-value
DelKey=key
DevRename=current-dev-name,new-dev-name
DevDelete=device-driver-name
DevAddDev=driver-name,configkeyword[,flag][,param-string]
Files=legal-dos-files-value
PrefixPath
=ldid[,ldid]...
RemKey
=key
Stacks=dos-stacks-value

The [Update ConfigSys] section provides commands to add, delete, or rename commands in Config.sys. The update-config-section name must appear in an UpdateCfgSys entry in the [Install] section.

Not all entries are needed or required. This section may contain as many DevRename, DevDelete, and DevAddDev entries as needed, but the other commands may only be used once per section. When processing this section, Setup processes all DevRenames entries first, all DevDelete commands second, and all DevAddDev commands last.

Not all entries are needed or required. An Update Config.sys section may contain as many DevRename, DevDelete, DevAddDev, DelKey, and RemKey items as needed, but the Buffers, Files, and Stacks items may only be used once in a section. When processing this section, the Installer processes all DevRenames items first, all DevDelete items second, and all DevAddDev items last.

Buffers Item

Buffers=legal-dos-buffer-value

Sets the number of file buffers. As it does with the Stacks item, the Installer compares the existing value with the proposed value and always sets the file buffers to the larger of the two values.

DelKey Item

DelKey=key causes the Config.sys command with the specified key to be remarked out in the Config.sys file. For example, the INF file item DelKey=Break would cause a Break=on command to be remarked out in the Config.sys file. The DelKey item has the same effect as the RemKey item. There can be multiple DelKey and/or RemKey items in a section of the INF file.

The key item is the Config.sys command to be remarked out.

DevAddDev Item

DevAddDev=driver-name,configkeyword[,flag][,param-string]

Adds a device or install command to the Config.sys file.

driver-name
Name of the driver or executable file to add. The installer validates the file name extension, ensuring that it is .sys or .exe.
configkeyword
Command name. Can be device or install.
flag
Optional placement flag. If 0, the command is placed at the bottom of the file. If 1, it is placed at the top. If flag is not given, 0 is used by default.
param-string
Optional command parameters. Must be valid for the given device driver or executable file.

DevDelete Item

DevDelete=device-driver-name

Deletes any line containing the specified file name from the Config.sys file.

device-driver-name
Name of a file or device driver. The Installer searches the Config.sys file for the name and deletes any line containing it. Because MS-DOS does not permit implicit file name extensions in Config.sys, each device-driver-name must explicitly specify the file name extension.

This example DevDelete item in an Update Config.sys section deletes lines 1 and 3 but not line 2 of the example Config.sys file:

DevDelete=Foo.sys

;; lines in CONFIG.SYS 
Device=Foo.sys ;; line #1 
Install=foo.exe ;; line #2 
Device=Foo.sys /d:b800 /I:3 ;; line #3

DevRename Item

DevRename=current-dev-name,new-dev-name

Renames a device driver in the Config.sys file.

current-dev-name
Name of the device driver or executable file to rename. The installer looks for the name on the right side of a device or install command in the Config.sys.
new-dev-name
New name for driver or executable file.

Files Item

Files=legal-dos-files-value

Sets the maximum number of open files in the Config.sys file. As it does with the Stacks item, the Installer compares the existing value with the proposed value and always sets the maximum number of open files to the larger of the two values.

legal-dos-files-value
A legal MS-DOS files value.

PrefixPath Item

PrefixPath=ldid[,ldid]...

Appends the path associated with the given LDID to the path command.

ldid
Can be any of the predefined LDID values or a new value defined in the INF. For a definition of all the predefined LDID values, see the "Reference" topic about the DestinationDirs section.

RemKey Item

RemKey=key causes the Config.sys command with the specified key to be remarked out in the Config.sys file. For example, the INF file item RemKey=Break would cause a Break=on command to be remarked out in the Config.sys file.

The RemKey item has the same effect as the DelKey item. There can be multiple RemKey and/or DelKey items in a section of the INF file.

key
The key of the Config.sys command to be remarked out.

Stacks Item

Stacks=dos-stacks-values

Sets the number and size of stacks in the Config.sys file. The Installer compares the existing value with the proposed value and always sets the stacks to the larger of the two values. For example, if Config.sys contains stacks=9,218 and an INF contains stacks=5,256, the installer sets to new value to stacks=9,256.

legal-dos-stacks-value
A legal MS-DOS stacks value.

[Update INI] Section

Syntax

[update-ini-section-name]
ini-file, ini-section, [old-ini-entry], [new-ini-entry], [flags]

Replaces, deletes, or adds entries in the given INI file. The update-ini-sectionname must appear in an UpdateInis entry in the [Install] section.

ini-file
Name of the INI file containing the entry to change. For more information about specifying the INI file name, see the comments below.
ini-section
Name of the section containing the entry to change.
old-ini-entry
Usually in the form Key=Value. (Optional.)
new-ini-entry
Usually in the form Key=Value. (Optional.) Either the key or value may specify replaceable strings. For example, either the key or value specified in the new-ini-entry parameter may be %String1%, where the string that replaces %String1% is defined in the Strings section of the INF file.

The optional action flags can be one of these values:

0 Default. If old-ini-entry key is present in an INI file entry, that entry is replaced with new-ini-entry. Note that only the keys of the old-ini-entry parameter and the INF file entry must match; the value of each entry is ignored.
1 If both key and value of old-ini-entry exist in an INI file entry, that entry is replaced with new-ini-entry. Note that the old-ini-entry parameter and the INF file entry must match on both key and value for the replacement to be made (this is in contrast to using an action flag value of 0, where only the keys must match for the replacement to be made).
2 If the key in the old-ini-entry parameter does not exist in the INI file, then no operation is performed on the INI file. If the key in the old-ini-entry parameter exists in an INI file entry and the key in the new-ini-entry parameter exists in an INI file entry, then the INI file entry that matches the key in the new-ini-entry parameter is deleted and the INI file entry that matches the old-ini-entry parameter is operated on in the following way: the key of the INI file entry is replaced with the key in the new-ini-entry parameter. If the key in the old-ini-entry parameter exists in an INI file entry and the key in the new-ini-entry parameter does not exist in an INI file entry, then an entry is added to the INI file made up of the key in the new-ini-entry parameter and the old value. Note that the match of the old-ini-entry parameter and an INI file entry is based on key alone, not key and value.
3 Same as flag parameter value of 2 described above, except match of the old-ini-entry parameter and an entry in the INF file is based on matching both key and value, not just the key.

To add new-ini-entry to the INI file unconditionally, set old-ini-entry to NULL. To delete old-ini-entry from the INI file unconditionally, set new-ini-entry to NULL. The wildcard character (*) can be used in specifying the Key and Value, and they will be interpreted correctly.

The ini-file name can be a string or a strings key. A strings key has the form %strkey% where strkey is defined in the [Strings] section in the INF file. In either case, the name must be a valid file name.

The name should include the name of the directory containing the file, but the directory name should be given as a logical directory identifier (LDID) rather than an actual name. Setup replaces an LDID with an actual name during installation.

An LDID has the form %ldid% where ldid is one of the predefined identifiers or an identifier defined in the [DestinationDirs] section. For LDID_BOOT and LDID_BOOTHOST, the backslash is included in the LDID, so %30%boot.ini is the correct way to reference Boot.ini in the root of the boot drive.

The following examples illustrate entries in this section:

%11%\sample.ini, Section1,, Value1=2  ; adds new entry
%11%\sample.ini, Section2, Value3=*,  ; deletes old entry
%11%\sample.ini, Section4, Value5=1, Value5=4  ; replaces old entry

[Update IniFields] Section

Syntax

[update-inifields-section]
ini-file, ini-section, profile-name, [old-field], [new-field]

Replaces, adds, and deletes fields in the value of a given INI entry. Unlike the [Update INI] section, this section replaces, adds, or deletes portions of a value in an entry rather than the whole value. The update-inifields-section name must appear in an UpdateIniFields entry in the [Install] section.

Any previous comments in the line are removed because they might not be applicable after changes. When looking in the INI file for fields in the line, spaces, tabs, and commas are used as field delimiters. However, a space is used as the separator when the new field is appended to the line.

[Add Registry] Section

Syntax

[add-registry-section]
reg-root-string, [subkey], [value-name], [Flag], [value]

Adds subkeys or value names to the registry, optionally setting the value. The add-registry-section name must appear in an AddReg entry in the [Install] section.

[Delete Registry] Section

Syntax

[del-registry-section]
reg-root-string, subkey, [value-name]

Deletes a subkey or value name from the registry. The del-registry-section name must appear in an DelReg entry in the [Install] section. This section can contain any number of entries. Each entry deletes one subkey or value name from the registry.

[Ini to Registry] Section

Syntax

[ini-to-registry-section]
ini-file, ini-section, [ini-key], reg-root-string, subkey, flags

Moves lines or sections from an INI file to the registry, creating or replacing an entry under the given key in the registry. The ini-to-registry-section name must appear in an Ini2Reg entry in the [Install] section.

[DestinationDirs] Section

Syntax

[DestinationDirs]
file-list-section=ldid[,subdir ]
DefaultDestDir=ldid[,subdir ]

The [DestinationDirs] section defines the destination directories for the given [File-List] sections and optionally defines the default directory for any [File-List] sections that are not explicitly named.

file-list section
Name of a [File-List] section. This name must have been defined in a Copyfiles, RenFiles, or DelFiles entry in the [Install] section.
Ldid
Windows setup, installation and back-up destination directories.

The following table presents possible names, values, and the use of the directories for LDIDS.

LDID Information

Name of LDID Value Directory use
LDID_SRCPATH 1 Source of temporary installation setup directory used by setup, this is only valid during regular install and contains the INF and other binary files. May be read-only location.
LDID_SETUPTEMP 2 Temporary setup directory for install path to uninstall location, this is where we backup files that will be overwritten.
LDID_UNINSTALL 3 Uninstall (backup) directory path for the copy engine.
LDID_BACKUP 4 BUGBUG: backup directory for the copy engine, not used temporary setup directory used by setup, this is only valid during regular install and is guaranteed to be a read/write location for scratch space.
LDID_SETUPSCRATCH 5 Temporary setup directory for scratch space.
Windows destination directories of the installation
LDID_WIN 10 Destination \Windows directory (just user files).
LDID_SYS 11 Destination \Windows System directory.
LDID_IOS 12 Destination \Windows Iosubsys directory.
LDID_CMD 13 Destination \Windows Command (DOS) directory.
LDID_CPL 14 Destination \Windows Control Panel directory.
LDID_PRINT 15 Destination \Windows Printer directory.
LDID_MAIL 16 Destination \Mail directory.
LDID_INF 17 Destination \Windows *INF directory.
LDID_HELP 18 Destination \Windows Help directory.
LDID_FONTS 20 Destination \Windows Font directory.
LDID_VIEWERS 21 Destination \Windows Viewers directory.
LDID_VMM32 22 Destination \Windows VMM32 directory.
LDID_COLOR 23 Destination \Windows Color directory.
LDID_APPS 24 Applications folder location. Shared directories for net install.

Boot and old Windows and DOS directories

LDID Value Directory use
LDID_WINBOOT 26 Guaranteed boot device for windows.
LDID_MACHINE 27 Machine specific files.
LDID_HOST_WINBOOT 28 Boot and old \Windows and DOS directories.
LDID_BOOT 30 Root directory of boot drive.
LDID_BOOT_HOST 31 Root directory of boot drive host.
LDID_OLD_WINBOOT 32 Subdirectory off of Root (optional).
LDID_OLD_WIN 33 Old \Windows directory (if it exists).
LDID_OLD_DOS 34 Old \DOS directory (if it exists).
LDID_OLD_NET 35 Old network root directory, only valid during network GenUpgrade.
LDID_MOUSE 36 Path to MOUSE env. variable if set or same as LDID_WIN only valid after mouse class installer.

Variable LDIDs
Variable LDIDs (VarLDIDs) allow for INFs to reliably find the existing Program Files, Accessories, etc., locations.

Directories that have long file names or that may have extended characters in their names may have multiple LDIDs. For example, 28700 and 28701 both point to "Program Files", but 28700 corresponds to the short file name "Progra~1" while 28701 corresponds to the long file name. Likewise, 28700 and 28702 both point to the short name "Progra~1", but 28700 renders this name in the OEM character set whereas 28702 renders it in ANSI characters. Different LDIDs are appropriate for different uses. In general, OEM/SFN LDIDs are uses for file copying, ANSI/LFN are used for strings written to the registry, and ANSI/SFN are used for Setup.ini entries that create start menu shortcuts.

The flag values at the end of the VarLDID.LFN and VarLDID.SFN sections show how the directories are represented internally as strings. The flag values have the following meanings:

0 = OEM/SFN (Default)1 = ANSI/SFN2 = OEM/LFN3 = ANSI/LFN

subdir
Name of the directory, within the directory named by ldid, to be the destination directory.

The optional DefaultDestDir entry provides a default destination for any Copyfile entries that use the direct copy notation (@filename) or any [File-List] section not specified in the [DestinationDirs] section. If DefaultDestDir is not given, the default directory is set to LDID_WIN.

This example sets the destination directory for the MoveMiniPort section to the \Windows Iosubsys directory, and sets the default directory for other sections to be the \BIN directory on the boot drive:

[DestinationDirs]
MoveMiniPort=12
; Destination for MoveMiniPort Section is windows\iosubsys
DefaultDestDirs=30,bin  ; Direct copies go to Boot:\bin

[File-List] Section

A [File-List] section lists the names of files to be copied, renamed, or deleted. Entries in this section have three forms, depending on the type of entry in the [Install] section that defines the section name. In addition, the file-list-section name must appear in the CopyFiles entry.

A [File-List] section for a CopyFiles entry has this form:

[file-list] section
destination-file-name,[source-file-name],[temporary-file-name]

destination-file-name
Name of the destination file. If no source file name is given, this is also the name of the source file.
source-file-name
Name of the source file. Required only if the source and destination names are not the same.
temporary-file-name
Name of the temporary file for the copy. Setup copies the source file, but gives it the temporary file name. The next time Windows 98 starts, it renames the temporary file to the destination file name. This is useful for copying files to a destination that is currently open or in use by Windows.

The following example copies three files:

[CopyTheseFilesSec]
file11                   ; copies file11
file21, file22, file23   ; copies file22, temporarily naming it file23
file31,file32            ; copies file32 to file31

A [File-List] section for a RenFiles entry has this form:

[file-list-section]
new-file-name,old-file-name

The file-list-section name must appear in the RenFiles entry.

This example renames the files FILE42, FILE52, and FILE62 to FILE41, FILE51, and FILE61, respectively:

[RenameOldFilesSec]
file41,file42
file51,file52
file61,file62

A [File-List] section for a DelFiles entry has this form:

[file-list-section]
filename

The file-list-section name must appear in the DelFiles entry.

This example deletes three files:

[DeleteOldFilesSec]
file1
file2
file3

In the preceding examples, the given file names are assumed to have been defined in the [SourceDisksFiles] section and the logical disk numbers that appear in this section have been defined in the [SourceDisksNames] section.

[SourceDisksFiles] Section

Syntax

[SourceDisksFiles]
filename=disk-number

Names the source files used during installation and identifies the source disks that contain the files. The ordinal of the source disk defined in disk-number must be defined in the [SourceDiskNames] section.

This example identifies a single source file, SRS01.386, on the disk having ordinal 1:

[SourceDisksFiles]
SRS01.386 = 1

[SourceDisksNames] Section

Syntax

SourceDisksNames]disk-ordinal="disk-description",disk-label,disk-serial-number

Identifies and names the disks used for installation of the given device drivers.

This example identifies one source disk and assigns it ordinal 1. The disk description is given as a strings key:

[SourceDisksNames]
1 = %ID1%, Instd1, 0000-0000