The new INF file format contains many types of named sections. Some of these are only used when installing device drivers and are not described in this document. For more information about these sections, see the DDK Programmer's Guide.
When you create an INF file, you do not have to include every type of section. The sections you use will depend on your installation procedure.
The setup functions use the following INF sections.
[Version] | Contains information about the INF file. |
[Install] | Contains a list of the INF sections that the setup functions process during the installation. |
[Add Registry] | Contains information used to add subkeys or value names to the registry. |
[Copy Files] | Contains source filenames and can specify additional copying behavior. |
[Delete Registry] | Contains information used to delete a subkey or value name from the registry. |
[Delete Files] | Contains the filenames of files to delete, and can specify additional deletion behavior. |
[INI File to Registry] | Contains information used to move lines or sections from an INI file to the registry. |
[Rename Files] | Contains the source and target filenames for renaming operations. |
[Update INI Fields] | Contains information used to replace, add, or delete fields in an INI entry. |
[Update INI File] | Contains information used to replace, add, or delete an INI entry. |
[Services] | Lists the services to add or install. |
[Service Install] | Contains information used to install the service listed in the AddService key of the Services section. |
[DestinationDirs] | Maps Copy Files sections to a destination directory. |
[SourceDisksFiles] | Maps the source files to their source location. |
[SourceDisksNames] | Assigns an ordinal value to the source disks and can store additional information about the source disks. |
[EventLog Install] | Contains information used to add an event message to the registry. |
[Strings] | Maps string keys (values in the INF file surrounded by percent signs (%)) to replacement strings. |
The only section that must be included is the Version section. The setup functions use this section to recognize an INF file as formatted for Windows 95 and Windows NT.
Each section title in the INF file, must be enclosed by square brackets ([ ]). In general, you can specify the title for an INF section. The exceptions to this are the DestinationDirs, SourceDisksFiles, SourceDisksNames, Strings, and Version sections. The titles of these sections must be identical to the section type. For example:
[DestinationDirs]
The SourceDisksNames and SourceDisksFiles sections can be specified with a platform-specific suffix. The following example shows an Intel-specific SourceDisksNames section.
[SourceDisksNames.x86]
The setup functions programmatically determine the platform of the user's system. If the setup functions find platform-specific SourceDisksNames and SourceDisksFiles sections that match the user's platform, the setup functions use the platform-specific sections. Otherwise the setup functions use the default (non-suffixed) SourceDisksNames and SourceDisksFiles sections.
The formatting of lines in a section varies according with its type. For more information about the format of a particular section, see INF File Format Reference.