Using the Printer-Specific Windows 95 INF File Extensions

Your monitor or print processor DLLs can be installed using statements in the INF file Windows 95 uses to install your printer driver. Printer extension statements for INF files are defined for Windows 95 and this section describes how these printer extension statements are used and provides reference material for each statement. This section also describes how these INF file printer extensions statements are used in the context of Windows 95 device Plug and Play.

Under Windows 3.1x, the Control Panel Printers applet has some limitations on installing printer drivers. This caused some printer vendors to develop their own installation utilities to work around these limitations.

Under Windows 95, the mechanism for installing printer drivers is different, removing the Windows 3.1x limitations. A new user interface is also provided in Windows 95 that corrects the problems users have reported with the Windows 3.1x Control Panel Printers applet.

In order to support the automatic Plug and Play printer installation described in the section "Plug and Play Printer Installation" and to support the manual printer installation method for non-Plug and Play printers that is described in this section, the printer INF file format for Windows 95 differs from the INF file format used with Windows 3.1x. This section defines the printer-specific changes to the INF file format and content. If you are developing a Windows 95 INF file for your printer installation, you must read the chapter "Windows 95 INF Files" in addition to this section to get all the information you need to do the job.

Note that the OEMSETUP.INF file format for printer drivers from Windows 3.1x will continue to be supported in Windows 95 for backwards compatibility, but all printer vendors are strongly encouraged to use the new INF file format described here and in the chapter "Windows 95 INF Files."

For Plug and Play printer installation and to use any of the new options for manual printer installation using the Add Printer icon, you will have to use the new INF file format and statements.

All of the printer-specific Windows 95 INF file extensions are individual lines that can be added to the simple text INF file. Each line has the form key=value. There are just over a dozen printer-specific keys that can be used and you only need to use a key to override the default. The table below lists the keys and defaults.

Key

Description

Default Value

ConfigFile

Names the DLL to call to configure the printer.

The file named in the DriverFile statement.

DataFile

Names a file that contains printer-specific information. For example, this may be the mini driver data file or, for Post Script printers, the .SPD file.

Install section name.

DataSection

Names another section of the INF file that contains printer-specific key=value statements that can be used by more than one Install section in the INF file.

There does not have to be a Data section in an INF file or any DataSection statements in any of the INF file installer sections. See the section "Printer INF File Data Section" for an example of how to use a Data section to reduce typing and clerical errors while you are developing a printer INF file.

DefaultDataType

Default datatype used by the printer and print processor associated with the printer.

Raw

DriverFile

Names the printer driver (.DRV) file to install.

Install section name.

HelpFile

Names the help file associated with the printer model.

No help file.

LanguageMonitor

User-displayable name and DLL filename of language monitor used by the printer model.

No language monitor.

NoTestPage

Instructs the Windows 95 printer installation process to not prompt the user with a test page printing option as the last step of a successful printer installation.

The user is prompted with a test page printing option, unless a VendorInstaller or VendorSetup statement is used in the INF file.

NotSelectedTimeOut

Not-selected timeout value for the printer, measured in seconds.

45 seconds.

PortMonitor

User-displayable name and DLL filename of port monitor used by the printer model.

Default port monitor, which is provided by Microsoft as part of SPOOLSS.DLL..

PrintProcessor

User-displayable name and DLL filename of the print processor used by the printer model.

Default print processor, which is provided by Microsoft as part of SPOOLSS.DLL.

RetryTimeout

Retry timeout value for the printer, measured in seconds.

15 seconds.

VendorInstaller

Names a vendor-provided Win32 DLL that performs the entire printer installation process, and the exported entry-point to call in that DLL. Can only be used for Plug and Play devices.

No vendor installer DLL.

VendorSetup

Names a vendor-provided Win32 DLL to be run after normal printer installation is accomplished, and the exported entry-point to call in the DLL.

No vendor setup DLL.


Printer INF File Install Sections

Regardless of which of the printer extension keys you use, always put them in the INF file Install section for the printer, or in a Data section referred to by the Install section. This is illustrated in the following sections from a printer INF file:


[Manufacturer]
"HP"

[HP]
"HP LaserJet 4ML"  = HPPCL5MS.DRV.BIDI,HP_LaserJet_4ML,Hewlett-PackardLaserECF6
"HP LaserJet 4ML Postscript" = HP4ML_V4.SPD,LPTENUM\Hewlett-PackardHP_LaECF6,Hewlett-Packard HP_LaECF6,HP_LaserJet_4ML_PostScript,Hewlett-PackardLaserC029
;
; Install Sections
;
[HP4ML_V4.SPD]
CopyFiles=@HP4ML_V4.SPD,PSCRIPT
DataSection=PSCRIPT_DATA

[HPPCL5MS.DRV.BIDI]
CopyFiles=@HPPCL5MS.DRV,@PJLMON.DLL,UNI,FINSTALL
DataSection=UNI_DATA
DriverFile=HPPCL5MS.DRV
DataFile=HPPCL5MS.DRV
LanguageMonitor=%PJL_MONITOR%
;
; Copy Sections
;
[FINSTALL]
FINSTALL.DLL
FINSTALL.HLP

[PSCRIPT]
PSCRIPT.DRV
PSCRIPT.HLP
PSCRIPT.INI
TESTPS.TXT
APPLE380.SPD
FONTS.MFM
ICONLIB.DLL
PSMON.DLL

[UNI]
UNIDRV.DLL
UNIDRV.HLP
ICONLIB.DLL
;
; Data Sections
; These sections contain data that is shared between devices
;
[PSCRIPT_DATA]
DriverFile=PSCRIPT.DRV
HelpFile=PSCRIPT.HLP
LanguageMonitor=%PS_MONITOR%

[UNIDATA]
HelpFile=UNIDRV.HLP
DefaultDataType=EMF
;
; Localizable strings
;
[Strings]
PJL_MONITOR="PJL Language Monitor,PJLMON.DLL"
PS_MONITOR="PostScript Language Monitor,PSMON.DLL"

This INF file is used in the installation of several different Hewlett-Packard printers. The manufacturer's name section, [HP], names the two printer product-names that can be installed using this INF file: HP LaserJet 4ML and HP LaserJet 4ML Postscript.

Also specified in the section named [HP] are the Install sections where the printer-specific keys like DriverFile, DataFile, and LanguageMonitor will be found. The names of the two Install sections in this INF file are HPPCL5MS.DRV.BIDI and HP4ML_V4.SPD.

Printer INF File Data Section

Data sections contain only printer extension keys. There may be any number of Data sections in a printer INF file, from zero to a maximum number which matches the number of Install sections that are in the INF file. More than one Install section in an INF file can reference the same Data section.

To be recognized by the printer installer, a Data section must be named in a DataSection statement in an Install section of the INF file.

If a key is used in both an Install section and the Data section that Install section references, the value in the Install section takes precedence.

Examples of Install and Data Section Relationships

It is instructive to look at the two Install sections, [HPPCL5MS.DRV.BIDI] and [HP4ML_V4.SPD], just to see how many of the dozen or so printer keys are used in each one. The [HPLJP_V4.SPD] section is the simplest:


[HP4ML_V4.SPD]
CopyFiles=@HP4ML_V4.SPD,PSCRIPT
DataSection=PSCRIPT_DATA

The CopyFiles key is common to all INF file install sections, so the [HP4ML_V4.SPD] section has only one statement with a printer-specific key:


DataSection=PSCRIPT_DATA

This statement names the only other section in the INF file that can contain printer-specific keys, the Data section. In fact, the Data section will contain only printer-specific keys, as is shown below:


[PSCRIPT_DATA]
DriverFile=PSCRIPT.DRV
HelpFile=PSCRIPT.HLP
LanguageMonitor=%PS_MONITOR%

[Strings]
PS_MONITOR="PostScript Language Monitor,PSMON.DLL"

Note that since only four printer-specific keys are used in the Install section for this printer model and in its Data section, defaults are used for the other keys during printer installation. Following is a list of the default values that are used:


ConfigFile=PSCRIPT.DRV      ; default is driver filename
DataFile=HPLJP_V4.SPD       ; default is install section name
DefaultDataType=RAW         ; 
NoTestPage=1                ; prompt user with Test Page opportunity
NotSelectedTimeOut=45       ; measured in seconds
PortMonitor=PORTMON.DLL     ; Microsoft-provided port monitor
PrintProcessor=WINPRINT.DLL ; Microsoft-provided print processor
RetryTimeout=15             ; measured in seconds
VendorInstaller=""          ; no vendor-provided installer
VendorSetup=""              ; no vendor-provided post-installation
                            ; step

The other Install section, [HPPCL5MS.DRV.BIDI], also uses a Data section, named [UNIDATA]. The [HPPCL5MS.DRV.BIDI] Install section looks like this:


[HPPCL5MS.DRV.BIDI]
CopyFiles=@HPPCL5MS.DRV,@PJLMON.DLL,UNI,FINSTALL
DataSection=UNI_DATA
DriverFile=HPPCL5MS.DRV
DataFile=HPPCL5MS.DRV
LanguageMonitor=%PJL_MONITOR%

[Strings]
PJL_MONITOR="PJL Language Monitor,PJLMON.DLL"

The Data section [UNI_DATA] contains two printer-specific keys, HelpFile and DefaultDataType.


[UNI_DATA]
HelpFile=UNIDRV.HLP
DefaultDataType=EMF

Printer-specific statements can be distributed between an Install section and a Data section any way that is convenient for you, with the exception that if a DataSection key is used it must be used in the Install section. Note that it is not necessary to use a Data section in your printer INF file, even though both of the above example Install sections do use a Data section.