2.3.1  INF File Format Reference

The format of the Windows NT 4.0- and Windows 95-style INF files differs from the Windows NT 3.x INF files. These new INF files do not contain installation scripts. All of the installation procedures are included in the setup program; the INF file acts as a resource, containing formatting and file information.

An INF file is made up of a set of named sections. To be used by the operating system installer, a section must contain one or more items. There can be any number of sections in an INF file.

There are approximately 20 types of sections that can be used in an INF file. Each type of section has a particular purpose; for example, to install a service or add entries to the registry.

INF files must follow these general rules:

·Sections begin with the section name enclosed in brackets.

·Values can be expressed as replaceable strings using the form %strkey%. To use a % character in the string, use %%. The strkey must be defined in a Strings section of the INF file.

·Each INF file must contain a Version section identifying it as a Windows NT 4.0/Windows 95-compatible file.

Three sections from a sample INF file are shown below, so you can more easily visualize the an INF file being made up of sections and each section containing one or more items. The section named Version contains five items, the section named DestinationDirs contains one item, and the section named ControlFlags contains three items.

[Version]

Signature="$Windows NT$"

Class=Mouse

ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}

Provider=%Provider%

LayoutFile=layout.inf

 

[DestinationDirs]

DefaultDestDir=12

 

[ControlFlags]

ExcludeFromSelect.NTAlpha=*PNP0F0D,*PNP0F11,*PNP0F00,*PNP0F02,*PNP0F15

ExcludeFromSelect.NTMIPS=*PNP0F0D,*PNP0F11,*PNP0F00,*PNP0F02,*PNP0F15

ExcludeFromSelect.NTPPC=*PNP0F0D,*PNP0F11,*PNP0F00,*PNP0F02,*PNP0F15

 

The remainder of this section describes the syntax and meaning of the items used in each type of INF file section. The following sections are described:

Add Registry

ClassInstall32

ControlFlags

Copy Files

Delete Registry

Delete Files

DestinationDirs

Device

EventLog Install

HW

Ini File to Registry

Install

Log Config

Manufacturer

Rename Files

Service Install

Services

SourceDisksFiles

SourceDisksNames

Strings

Update INI Fields

Update INI File

Version