Previous Next

INF Ini2Reg Directive

[DDInstall] |
[DDInstall.CoInstallers] |
[ClassInstall32] |
[ClassInstall32.ntx86] |
[ClassInstall32.ntia64]

 

Ini2Reg=ini-to-registry-section[, ini-to-registry-section] ...
 
 

An Ini2Reg directive references one or more named sections in which lines or sections from a supplied INI file are moved into the registry, thereby creating or replacing one or more value entries under a specified key.

The Ini2Reg 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.

This directive is almost never specified in INF files for installations on NT-based systems, due to the lack of necessity for INI files on their distribution media. If an INF file is to be used for installing devices on Windows XP and later versions of the operating system, the INF file should not contain Ini2Reg directives. INF files containing Ini2Reg directives will not pass "Designed For Windows" logo testing, will not receive a digital signature, and thus will be untrusted by Setup (see How Setup Selects Drivers).

Comments

A given ini-to-registry-section name must be unique to the INF file. Each INF-writer-created section name must be unique within the INF and must follow the general rules for defining section names. These rules are described in General Syntax Rules for INF Files. For information about how to use the system-defined .nt, .ntx86, and .ntia64 extensions, see Creating INF Files for Multiple Platforms and Operating Systems.

Each named section referenced by an Ini2Reg directive has the following form:

[ini-to-registry-section]
 

ini-file,ini-section,[ini-key],reg-root,subkey[,flags]
...

An ini-to-registry-section can have any INF-writer-determined number of entries, each on a separate line.

Ini2Reg-Referenced Section Entries

ini-file
Specifies the name of an INI file supplied on the source media. This value can be expressed as a filename or as a %strkey% token that is defined in a Strings section of the INF file.
ini-section
Specifies the name of the section within the given INI file containing the registry information to be copied.
ini-key
Specifies the name of the key in the INI file to copy to the registry. If this value is omitted, the whole ini-section is to be transferred to the specified registry subkey.
reg-root
Identifies the root of the registry tree for other values supplied in this entry. For specifics, see the reference for the AddReg directive.
subkey
Identifies the subkey to receive the value, expressed either as a %strkey% token defined in a Strings section of the INF or as an explicit registry path (key1\key2\key3...) from the given reg-root.
flags
Specifies (in bit 0) how to handle the INI file after transferring the given information to the registry and/or (in bit 1) whether to overwrite existing registry information, as follows:
Bit zero = 0
Do not remove the given information from the INI file after copying it into the registry. This is the default.
Bit zero = 1
Delete the given information from the INI file after moving it into the registry.
Bit one = 0
If the specified subkey already exists in the registry, do not transfer the INI-supplied information into this subkey. Otherwise, create the given subkey in the registry with this INI-supplied information as its value entry. This is the default.
Bit one = 1
If the specified subkey already exists in the registry, replace its value entry with the INI-supplied information.

The INF provides the full path to the given ini-file on the distribution media in one of the following ways:

See Also

AddInterface, AddReg, ClassInstall32, DDInstall, DDInstall.CoInstallers, InterfaceInstall32, SourceDisksFiles, SourceDisksNames, Strings, UpdateIniFields, UpdateInis, Version