Sams Teach Yourself Samba in 24 Hours

ContentsIndex

Hour 8: Printers

Previous HourNext Hour

Sections in this Chapter:

 

Automatic Printer Driver Installation

Windows 95 and Windows 98 enable the automatic installation of printer driver files using Point and Print. Samba implements the functionality required to support such automatic installation.

Although the setup required to support Point and Print installation is described in detail in the Samba documentation directory (PRINTER_DRIVER.txt), I will explore it in some detail here.

First, you must set up a [printer$] share where all the driver files reside. This file share looks like this:

[printer$]
    path = /usr/local/samba/printer
    public=yes
    writable= no
    browsable=yes

Remember to create this directory so that the file share has somewhere to put files.

The next step is to create the printer definition file so that Windows 9x knows how to install the printers you have made available for automatic installation. To do this, you need to obtain the Windows INF files msprint.inf and msprint2.inf from the directory C:\WINDOWS\INF on one of your Windows machines. Sometimes these files might be located in a different directory. If you use unsupported or updated drivers, you must first install these drivers on your Windows 9X system, then copy the oemNN.inf file, and use it instead of msprint.inf.

Note - The file is not always exactly named oemNN.inf; rather, it might have a similar name. You can find which one you need by checking for the correct printer name within each such file.

When you have copied these files to your Samba server, you must use the make__printerdef program that comes with Samba to make an entry in the printers.def file for your printer. Find the exact name of the printer you are defining (the name Windows knows it as) by looking in the appropriate INF file. For printers with names starting from A to K, look in msprint.inf; otherwise, look in msprint2.inf. Here you assume a printer type of HP LaserJet 4 Plus. Create a new printers.def entry in the following way:

make_printerdef msprint.inf "HP LaserJet 4 Plus">> printers.def

Make sure that the new printers.def entry goes on the end of the printers.def file. In these examples, you put it in /usr/local/samba/lib.

When make_printerdef executes, it prints out on stderr the files required to be installed. All these files need to be out into the [printer$] share you have defined above. The files generally are all in the C:/WINDOWS/SYSTEM directory. In the case of the HP LaserJet 4 Plus, the following files are required:

FINSTALL.DLL, FINSTALL.HLP, HPPCL5MS.DRV, ICONLIB.DLL,PJLMON.DLL, UNIDRV.DLL, UNIDRV.HLP

Lastly, you need to add some additional parameters to your smb.conf file. One of these goes in the global section and specifies the location of the printer definitions file:

[global]
    ...
    printer driver file = /usr/local/samba/lib/printers.def
    ...

This is the file where you put all the printer definition entries created with the make_printerdef program.

The other parameters, printer driver and printer driver location, need to go in each printer share where you want support for automatic installation. The following shows your first-printer modified to support automatic installation:

[first-printer]
    comment = My first printer
    path = /var/spool/samba
    printable = yes
    printer driver = HP LaserJet 4 Plus
    printer driver location = \\%h\PRINTER$

Don't worry about the %h in the last line. It is one of the variable substitutions that Samba can make in the smb.conf file. These will be explained in more detail in Hour 10, "Server-Side Automation."

When you have made all these changes to your smb.conf file and restarted Samba, you can try out automatic installation of the driver for the printer you defined. Bring up your server in Network Neighborhood, as shown in Figure 8.5. Then double-click first-printer. This should start the installation of the printer. You are presented with the following window.

Figure 8.5
Your printer is about to be installed.

Click Yes to continue setting up the printer. This takes you through the Add Printer Wizard. Select Next and you are presented with the window in Figure 8.6.

Figure 8.6
The Add Printer Wizard knows it is dealing with an HP LaserJet 4 Plus.

Here you can see that the Add Printer Wizard knows that it is dealing with an HP LaserJet 4 Plus. This is because Samba has told it so. If you complete the printer setup and print a test page, you should eventually see the test page print out on your printer.

Automatic installation can be enormously time saving on a medium to large installation, because it makes installing new printers a breeze for Windows 9x systems.

Sams Teach Yourself Samba in 24 Hours

ContentsIndex

Hour 8: Printers

Previous HourNext Hour

Sections in this Chapter: