INF UpdateIniFields Directive
Note If you are building a universal or mobile driver package, this directive is not valid. See Using a Universal INF File.
An UpdateIniFields directive references one or more named sections in which fine-grained modifications within the lines of an INI file can be specified.
[DDInstall] | [DDInstall.CoInstallers] | [ClassInstall32] | [ClassInstall32.ntx86] | [ClassInstall32.ntia64] | (Windows XP and later versions of Windows) [ClassInstall32.ntamd64] (Windows XP and later versions of Windows) UpdateIniFields=update-inifields-section[,update-inifields-section]...
Each named section referenced by an UpdateIniFields directive has the following form:
[update-inifields-section] ini-file,ini-section,profile-name[,old-field][,new-field][,flags] ...
An update-inifields-section can have any INF-writer-determined number of entries, each on a separate line.
Specifies the name of an INI file supplied on the source media and, implicitly, that of a to-be-updated INI file on the target computer. This value can be expressed as a filename or as a %strkey% token that is defined in a Strings section of the INF file.
Specifies an existing field within the given line. If new-field is omitted from this section entry, this field is deleted from the given line. Otherwise, the given new-field value should replace this field.
Specifies (in bit 0) how to interpret given old-field and/or new-field if either or both contain an asterisk (\), and/or (in bit 1) which separator character to use when appending a given *new-field to the given line, as follows:
Bit zero = 0
Interpret any asterisk (*) in the specified old-field and/or new-field entries literally, not as a wild-card character, when searching for a match in the given line of the INI file. This is the default value.
The UpdateIniFields directive is almost never specified in INF files for installations on Windows because it is not necessary to have INI files on their distribution media. However, the UpdateIniFields directive is valid in any of the sections shown in the formal syntax statement, as well as in INF-writer-defined sections referenced by an AddInterface directive or referenced in an InterfaceInstall32 section.
Each update-inifields-section name must be unique to the INF file. Each INF-writer-created section name must be unique within the INF file and must follow the general rules for defining section names. For more information about these rules, see General Syntax Rules for INF Files.
Unlike a section referenced by the UpdateInis directive, a section referenced by UpdateIniFields replaces, adds, or deletes parts of a line in an existing INI file line instead of affecting the whole value of a particular line. At least one of the old-field and/or new-field values must be specified in each section entry.
Any comments in a to-be-modified INI file line are removed because they might not be applicable after changes made according to this section. When looking for fields in the line in the INI files, spaces, tabs, and commas are interpreted as field delimiters. However, a space character is used as the default separator when a new field is appended to a line.
The INF provides the full path of the given ini-file on the distribution media in one of the following ways:
- In IHV/OEM-supplied INF files, by using the SourceDisksNames and SourceDisksFiles sections of this INF to explicitly specify the full path of each named source file that is not in the root directory (or directories) on the distribution media.
- In system-supplied INF files, by supplying one or more additional INF files, identified in the LayoutFile entry in the Version section of the INF file.