[This is preliminary documentation and subject to change.]
MultiOS.inf is a sample INF file that illustrates the general structure for using a single INF file to install different printer drivers on Windows® Server 2003, Windows® XP, Windows® 2000, and Windows® 9x (encompassing Windows 98, Windows 98 Second Edition, and Windows Millennium).
The sample includes specific INF constructs to demonstrate the following concepts:
Platform extensions, including consistent usage throughout the INF file.
Installation on multiple platforms from one INF file.
Installation of different local language versions of binaries from one INF file.
Review this document carefully, taking careful note of the sample's limitations.
In addition to the contents of this document, the sample INF file contains explanatory comments throughout.
Users of this sample INF file will need to add their own information, including file names, registry information, and company information in the Strings section, and adding additional Strings sections for additional local language support and so forth.
The sample INF file includes several DDInstall-related sections that are used on more than one Windows platform. These sections are:
CommonXPAddReg, WinXPCopyDriver and WinXPCopyDlls - common sections for installing on both platforms (x86 and ia64) for Windows XP only.
WinXPServiceInstallSection and WinXPServiceAddReg - common service installation sections for installing on both platforms (x86 and ia64) for Windows XP only.
CommonAddReg - common registry section for installing on all supported platforms - Windows 9x/ME, Windows 2000, and Windows XP.
When possible, the use of common sections reduces the likelihood of introducing errors in the completed INF file, while reducing the size and complexity of the INF file as well.
This sample INF file is saved as plain ASCII text (using Windows Notepad with the default ANSI encoding). As part of customizing this INF file for installing a specific device, you may need to save the INF file with Unicode encoding. Unicode allows the INF file writer the flexibility to mix locales that use different ANSI codepages. To save any text file with Unicode encoding using Windows Notepad, follow these steps:
Microsoft provides two useful tools for checking INF file structure and syntax:
ChkINF is a Perl script that checks the structure and syntax of Microsoft® Windows® 2000, Windows® XP and Windows® Server 2003 driver INF files. Results are presented in HTML format, and include a list of the errors and warnings detected in each INF file, with each error and warning shown next to the errant INF file entry. ChkINF is available in this DDK in the tools\chkinf directory.
Signability is a tool for ensuring that a driver package can be properly signed after it passes Designed for Windows Logo testing. Signability is available for download from the Hardware Compatibility Test Kit Web site at http://www.microsoft.com/hwtest/testkits.
Both of these tools are included in the Hardware Compatibility Test Kits used for Designed for Windows Logo testing.
Many devices are distributed with accompanying media (typically a CD) containing drivers targeted at multiple local languages and multiple versions of Windows. The table below presents one possible structure for organizing such media, so that multiple languages can be supported on Windows 9x, Windows NT 4.0, Windows 2000, Windows XP and Windows Server 2003.
Directory | Containing INF File | Notes |
\ (root directory) | NT4.inf | Unsigned Unicode INF file for Windows NT 4.0 only |
\Windows | MultiOS.inf | Signed Unicode INF file for Windows Server 2003, Windows 2000 and Windows XP |
\Win9xeng | Win9xEng.inf | Signed English language INF file for Windows 9x only |
\Win9xFra | Win9xFra.inf | Signed French language INF file for Windows 9x only |
\Win9xGer | Win9xGer.inf | Signed German language INF file for Windows 9x only |
Windows 9x does not recognize or handle localized Strings.LanguageID sections, necessitating the use of individual INF files for each supported locale.
Windows 9x does not recognize INF files stored with Unicode encoding, and will ignore any Unicode INF files it might encounter. In this media layout, the INF files targeted at non-Windows 9x platforms are saved with Unicode encoding, so Windows 9x will not see them. If this layout were presented to a Windows 9x user, the user would see a list that included only the Windows 9x INF files, and none of the Unicode INF files targeted at Windows NT 4.0, Windows 2000 or Windows XP or Windows Server 2003.
Because there is no way to differentiate a Windows NT 4.0 INF file from a joint Windows 2000/Windows XP/Windows Server 2003 INF file, a separate INF file should be provided for Windows NT 4.0 support. In the table above, the Windows NT 4.0 INF file is placed in the root directory of the media for easy discovery by Windows NT 4.0 users.
Windows NT 4.0 does not recognize driver signatures, so the INF file for Windows NT 4.0 can be unsigned. Even though this file will appear as a valid INF file to Windows 2000, Windows XP and Windows Server 2003, if the INF file (MultiOS.inf in the table above) targeted at these versions of Windows is signed, both of these versions of Windows will choose the signed INF file in preference to the unsigned INF file. See the "How Setup Selects Drivers" topic in the Windows DDK Documentation for additional details.
The ChkINF tool reports zero errors and the following four warnings when executed on this sample INF file:
The first warning, "NT-specific section(s) found. Ignoring general section", indicates that this INF file contains installation sections that are decorated with platform extensions (.NTx86 and .NTia64), as well as plain, undecorated installation sections ("DriverInstall" for example). Since ChkINF detected the decorated sections, it will not check any undecorated DDInstall sections it finds.
The other three warnings are related to the first. While ChkINF will not check undecorated DDInstall sections, it will report any unreferenced sections as an aid to INF developers. These three warnings are simply stating that these sections are not referenced anywhere else in the INF file. (Actually, the second and third unreferenced sections, "Win9xAddReg" and "Win9xCopyFiles", are referenced in the first unreferenced section, "DriverInstall". Due to presence of decorated DDInstall sections, ChkINF will not check this undecorated DDInstall section, and it and the two sections it references are thereby reported as unreferenced.)
This INF file is incomplete. Users of this sample will need to add their own information, including file names, registry information, and company information in the Strings section and so forth.
Note that Windows 9x does not recognize or handle localized Strings.LanguageID sections, and so the localization techniques exemplified in the sample INF file cannot be used on Windows 9x. See the section entitled Suggested Media Layout above for suggestions on handling Windows 9x. The installation sections for Windows 9x that are present in the INF file are included for illustrative purposes only.
As discussed in Warnings Generated by the ChkINF Tool above, the ChkINF tool reports zero errors and four warnings when executed on the sample INF file. These four warnings represent known issues with the INF file, and can be readily explained. Use of the ChkINF tool is strongly recommended when writing INF files.
As noted in Using the Sample above, this sample INF file is saved as plain ASCII text (saved from Windows Notepad with the default ANSI encoding).
File | Description |
MultiOS.htm | Readme for MultiOS.inf (this file). |
MultiOS.inf | Sample multi-platform, multi-language INF file. |
We welcome your comments, problem reports and wish-list requests. Please submit them by pointing your Internet browser to http://www.microsoft.com/ddk.
© Microsoft Corporation 2001-2003