Source Media for INF Files
The methods that you should use to specify source media for device files depend on whether your INF files ship separately from the operating system or are included with the operating system.
INF files for drivers that are delivered separately from the operating system specify where the files are located by using SourceDisksNames and SourceDisksFiles sections. If such an INF contains Include and Needs entries in the DDInstall section, those entries specify additional possible source locations.
If an INF has SourceDisksNames and SourceDisksFiles sections and no Include entries, the SourceDisksNames and SourceDisksFiles sections must list all the source media and source files in the kit except for the catalog and INF files.
Catalog files must be in the same location as the INF file. Catalog files must not be compressed. If the installation media includes multiple disks, then a separate copy of the INF and catalog files must be included on every disk. This is because the INF and catalog files must continue to be accessible throughout the entire installation.
In versions of Windows earlier than Windows Vista, if the files that support the device are included with the operating system, the INF must specify a LayoutFile entry in the Version section of the file. Such an entry specifies where the files reside on the operating system media. An INF that specifies a LayoutFile entry must not include SourceDisksNames and SourceDisksFiles sections.
Only system-supplied INF files should reference Layout.inf directly. OEM and IHV INF files that ship with the operating system can reference a common install section in a system-supplied INF (such as Mf.inf), and the system-supplied INF references the Layout.inf file.
If an INF has SourceDisksNames and SourceDisksFiles sections and Include and Needs entries, Windows uses the main INF file plus any of the included INF files to locate source media. It is especially important with included files to be as precise as possible when specifying source media and source file locations.
Consider the hierarchy of included INF files that are shown in the following figure:
This figure shows an INF file (MyMfDevice.inf) for a multifunction device. This INF file includes the system-supplied Mf.inf file. In turn, the system-supplied Mf.inf file includes the system-supplied Layout.inf file. When Windows searches for source media from which to copy a file referenced in MyMfDevice.inf, it looks for a SourceDisksFiles section in MyMfDevice.inf and in any included INF files that reference the file to be copied. Windows searches MyMfDevice.inf first, but it does not guarantee the order in which it searches the included INF files.
Decorated SourceDisksFiles sections take precedence over undecorated sections, even if the decorated INF section is in an included file. For example, for the INF files that are shown in the previous figure, if Layout.inf contains a [SourceDisksFiles.x86] section and MyMfDevice.inf contains only an undecorated [SourceDisksFiles] section, Windows uses the decorated section from Layout.inf first when it installs on an x86 computer. Therefore, an INF that includes other INF files should contain section names that use platform extensions.
Typically, a vendor-supplied INF should specify the location of the files in its driver package and should not cause Windows to search included INF files for file locations. In other words, a vendor INF that copies files should specify both a SourceDisksNames and a SourceDisksFiles section, those sections should be decorated with platform extensions, and those sections should contain information for all the files directly copied by the INF.
It is helpful if the vendor file names are as vendor-specific as possible, unless the installation is explicitly replacing a vendor-supplied file that shipped with the operating system.
Note the following rules when using Includes and Needs entries:
Includes and Needs entries can only be used to specify system-supplied INF files.
Needs entries cannot be nested. That is, a section identified by a Needs entry cannot itself contain a Needs entry.
An INF file that uses a section in another INF file by using the Include and Needs entries might have to use an accompanying section to maintain consistency. For example, if an INF file references the installation section (DDInstall) of another INF file in order to install the driver, it must reference an INF DDInstall.Services section to install the accompanying service. Such an INF file might have the following sections:
[DDInstall] Include = AnotherINFFile.inf Needs = AnotherINFFileDDInstall [DDInstall.Services] Include = AnotherINFFile.inf Needs = AnotherINFFileDDInstall.Services