Note If you are building a universal or mobile driver package, this directive is not valid. See Using a Universal INF File.
An UpdateInis directive references one or more named sections, specifying an INI file from which a particular section or line is to be read and applied to an existing INI file of the same name on the target computer. Optionally, line-by-line modifications from and to such INI files can be specified in the update-ini-section.
[DDInstall] | [DDInstall.CoInstallers] | [ClassInstall32] | [ClassInstall32.ntx86] | [ClassInstall32.ntia64] | (Windows XP and later versions of Windows) [ClassInstall32.ntamd64] (Windows XP and later versions of Windows) UpdateInis=update-ini-section[,update-ini-section]...
This directive is almost never specified in INF files for installation on Windows, due to the lack of necessity for INI files. However, the UpdateInis 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 named section referenced by an UpdateInis directive has the following form:
[update-ini-section] ini-file,ini-section[,old-ini-entry][,new-ini-entry][,flags] ...
An update-ini-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 the INI file to be updated 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 the name of the section within the given INI file. If the next two values are specified, this section contains an entry to be changed. If an old-ini-entry is omitted but a new-ini-entry is provided, the new entry is to be added as this section is read.
Either or both of key and value can be expressed as %strkey% tokens defined in a Strings section of the INF file. The asterisk (\) can be specified as a wild-card for either the *key or the value.
This is the default value for the flags entry if it is omitted.
If the given old-ini-entry key is present in the INI files, replace that key=value with the given new-ini-entry. Only the keys in the INI files must match. The corresponding value of each such key is ignored.
To add a new-ini-entry to the destination INI file unconditionally, omit the old-ini-entry value from the entry in the update-ini section of the INF.
To delete an old-ini-entry from the destination INI file unconditionally, omit the new-ini-entry value.
If the given old-ini-entry (key=value) exists in the INI files, replace it in the destination INI file that has the given new-ini-entry. Both the key and value of the specified old-ini-entry must match those in the INI files for such a replacement to be made, not just their keys as for the preceding flags value.
If the key that is specified for old-ini-entry cannot be found in the destination INI file, do nothing. Otherwise, the changes made depend on matches found in the INI files for the given keys of old-ini-entry and new-ini-entry, as follows:
If the key and value specified for old-ini-entry cannot be found in the INI files, do nothing. Otherwise, the changes made depend on matches found in the INI files for the given keys and values of old-ini-entry and new-ini-entry, as follows:
A given update-ini-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.
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.
Any filename specified within an old-ini-entry or new-ini-entry should designate the destination directory that contains that file. Such a destination directory path of a filename in an update-ini-section entry must be specified as a dirid. For lists of possible dirid values, see Using Dirids.