INF Ini2Reg Directive
Note If you are building a universal or mobile driver package, this directive is not valid. See Using a Universal INF File.
An Ini2Reg directive references one or more named sections in which lines or sections from a supplied INI file are moved into the registry. This creates or replaces one or more value entries under a specified key.
[ DDInstall ] | [DDInstall.CoInstallers] | [ClassInstall32] | [ClassInstall32.ntx86] | [ClassInstall32.ntia64] | (Windows XP and later versions of Windows) [ClassInstall32.ntamd64] (Windows XP and later versions of Windows) [ClassInstall32.ntarm] (Windows 8 and later versions of Windows) [ClassInstall32.ntarm64] (Windows 10 and later versions of Windows) Ini2Reg=ini-to-registry-section[,ini-to-registry-section]...
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.
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.
Identifies the root of the registry tree for other values supplied in this entry. For specifics, see the reference for the AddReg directive.
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.
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 specified subkey in the registry with this INI-supplied information as its value entry. This is the default.
The Ini2Reg directive is valid in any of the sections shown in the formal syntax statement. This directive is also valid in INF-writer-defined sections referenced by an AddInterface directive or referenced in an InterfaceInstall32 section.
If an INF file is used to install devices on Windows XP and later versions of Windows, the INF file should not contain Ini2Reg directives. INF files that contain Ini2Reg directives will not pass "Designed For Windows" logo testing, will not receive a digital signature, and therefore will be untrusted by Windows (see How Windows Selects Drivers).
Each ini-to-registry-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.
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, possibly, 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.