5.3.1 Downloading

If you choose Download Now (that is, upon exiting the installer) it is not a difficult task for the driver. The installer simply opens a Windows print job and sends down the fonts. Downloading fonts at startup (that is, when the user turns on the machine) is more complex.

To set up the downloading of permanent fonts at startup, the installer performs the following tasks:

1.Writes an executable program that prompts the user to download fonts.

2.Creates a batch that downloads the fonts and writes out the banner page.

3.Edits the AUTOEXEC.BAT file to call the download batch file.

The executable program presents the user with a prompt to choose whether or not to download permanent soft fonts. The program is stored in the driver's resources and written to its own file when the installer is setting up fonts for permanent downloading. The downloading batch file calls this executable program.

The program displays the following prompt:

Download PCL fonts to port name? [y/n]

If the user responds “no,” the program returns 1 and the batch file tests the ERRORLEVEL. The program then exits without downloading fonts.

If the user responds “yes,” the program returns an ERRORLEVEL of zero, and the batch file proceeds to download fonts. The batch file is called from the user's AUTOEXEC.BAT file. The installer edits the AUTOEXEC.BAT file and appends the following strings to the file:

command /c C:\PCLFONTS\SFLPT1.BAT

The string that calls the download batch file uses the MS-DOS “command /c” option. This enables MS-DOS to suspend execution of the AUTOEXEC.BAT file to carry out the downloading of file, then return to the execution of the AUTOEXEC.BAT file. Without “command /c,” MS-DOS would not return to executing the AUTOEXEC.BAT file (that is, any commands after the line in the AUTOEXEC.BAT file would not be executed).

If a user sets up fonts for permanent downloading, but they are not being downloaded to the printer, the commands in the AUTOEXEC.BAT file are probably not being executed. The problem may be solved by moving the commands in the AUTOEXEC.BAT file.

Although the entry the installer creates in the AUTOEXEC.BAT file may be moved in the file, it should never be modified. This is because the installer looks for the entry and modifies it if the user changes the fonts from permanent download to temporary. In this case, the installer inserts a rem command at the beginning of the entry. This has the effect of disabling the download entry without deleting it. If the user once again enters the installer and makes some fonts permanent, the installer will locate the entry in the AUTOEXEC.BAT file and remove the rem command.