Plea for assistance, you get enhanced printing back

papowell at astart.com papowell at astart.com
Mon Aug 14 18:56:09 GMT 2000


> On Sat, Aug 12, 2000 at 10:15:08AM +1000, Tim Potter wrote:
> [...]
> > > c)  remove a job via Samba
> > 
> > Using rm from smbclient should work.
> [...]
>
> >From inside smbclient:
>
> smb: \> help queue
> HELP queue:
>         show the print queue
>
> smb: \> help cancel
> HELP cancel:
>         <jobid> cancel a print queue entry
>
> I haven't tried them, but those look better than ls and rm
> to me.
>
>     Elrond
>

Ahh!!! Very good!

Now all we need is the 'details about stuff like the printer driver'
and I am... well... not as grumpy.

Here is installment 2:

!==
!== PRINTER_DRIVER.txt for Samba release 2.0.4 18 May 1999
!==
==========================================================================
	Supporting the famous PRINTER$ share
 
 	Jean-Francois.Micouleau at utc.fr, 10/26/97
	modified by herb at sgi.com 1/2/98
    modified by Patrick Powell <papowell at astart.com> 14 Aug 2000

===========================================================================

Disclaimer:

	This ONLY works with Windows 95
	It does NOT work with Windows NT 4

Goal:

	When you click on a samba shared printer, you can now install the driver
	automatically onto the Windows 95 machine, as you would from an NT server.

Background:

    The Microsoft Windows printing support uses the concept of a
    'printing device';  when you print a job the application actually
    opens the printing device and then performs a set of operations
    on the device, such as 'get page size',  'set font', and 'draw
    glyph'.  These operations are translated by the 'driver code'
    for the printing device into the appropriate output for the
    device.

    While this brief explanation has ignored many details,  it
    should be clear that the following items are needed to do
    printing:

    a) the set of files needed to implement the 'printer device'
    b) a 'device configuration' for a printer which provides the
       parameters and other information for a particular printing
       device.

    In order to make setting up printers simple,  Microsoft provides
    the necessary information for the 'device installation' facility
    in a file, usually with the name 'oemsetup.inf'.  This file is
    read by the Microsoft device installation facility and the
    entries are used to locate the required files,  set up various
    system configuration entries, and to install necessary support
    software.

    When you use the 'Control Panel/Printer/New Printer' facility,
    the Microsoft print setup facility uses the information that
    was provided by the device installation to create a printing
    device.

    Support for Network Drivers is provided by making this information,
    i.e. - the necessary files and setup information for the printer
    device, available over a network, rather than from a file.
    Unfortunately, this is not as simple as the 'oemsetup.inf' file
    method,  as there are matters of security,  file access, and
    other issues that have to be handled.
	
How To Set Up Driver Loading:

	First, create a new directory where you will put the driver
	files and make a share in smb.conf for it.  This is where
	the files for the printing device will be stored on the
    server and from where they will be fetched during the device
    installation process.

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

	Next you have to build the list of driver files required
	for a specific printer device and copy these files to the
    directory.  This is the most complicated thing to do.

    Start by making sure that the printer driver files and information
    are available and complete.  The easiest way to do this is to
    do a 'dummy' installation of the printer on a Windows 95 system.
    Choose the LPT0 as the output device.  Once you have finished
    setting up the server,  you can then remove the printer.

    By convention,  the printer device information is kept in the
    C:\WINDOWS\INF directory in various .inf files.  Supported printers
    have their information in either 'msprint.inf' and 'msprint2.inf'.
    If you have installed a print driver from a disk or a separate
    installation facility,  the driver information will be in a
    file with the name 'oemXXXXX.inf',  where XXXX is some number.

    After having installed the driver, get the files 'msprint.inf',
    'msprint2.inf', and the oemXXXX.inf files from the Windows 95
    computer.  Search them for your printer name.  For example, here is
    part of the MSPRINT.INF file:

     ;
     ; Model sections. Each section here corresponds with an entry listed in the
     ; [Manufacturer] section, above. The models will be displayed in the order
     ; that they appear in the INF file.
     ;
     ; Each model lists a variation of its own name as a compatible ID. This
     ; is done primarily as an optimization during upgrade.
     ;
     [Gen]
     %TTYNAME%                         = TTY.DRV,Generic_/_Text_Only
     
     [Apple]
     "Apple LaserWriter"               = APPLE230.SPD,Apple_LaserWriter
     "Apple LaserWriter II NT"         = LWNT_470.SPD,Apple_LaserWriter_II_NT
     "Apple LaserWriter Personal NT"   = A_PNT518.SPD,Apple_LaserWriter_Personal_NT 
     "Apple LaserWriter II NTX"        = LWNTX470.SPD,Apple_LaserWriter_II_NTX
     
    The make_printerdef program will extract driver information 
    from this file and put it into a format usable by Samba.
    This file is specified by the 'printer driver file' entry
    that we will put into the Samba smb.conf file:

        [global]
          # printer driver information is here
  		  printer driver file=/usr/local/samba/lib/printers.def


    Run the program 'make_printerdef' with the .inf file
    name and the printer name as parameters.  The output of this
    program should be appended to the 'printer driver file':

	Example:
		
    cd /usr/local/lib/samba   # cd to the directory containing .inf files
    cp printers.def printers.def.bak
	make_printerdef msprint.inf "Apple LaserWriter" \
      >>printers.def 2>/tmp/files
      OR
	make_printerdef oem8.inf "Wheeride Printer" \
      >>printers.def 2>/tmp/files
	 
    make_printerdef will extract the names of the required printer driver files
    and print them on STDERR,  which we have redirected to /tmp/files.
    You must locate these files on the Windows 95 system and copy them
	into the directory you created in step 1.  Make sure the copied file
    names match EXACTLY the names in /tmp/files.
	
	Finally, you need to update smb.conf with
    a) the directory containing the printer drivers files
       i.e. - [PRINTER$] share
    b) the location of the share directory for clients
       i.e. - [global] \\servername\PRINTER$
    c) the file containing the printer driver information
       i.e. - [global] /usr/local/samba/lib/printers.def
    d) the name of the driver,  which is used to extract
       the driver information from the printers.def
       file and download the drivers from the PRINTER$

	Example:
        
        [global]
          # set defaults
  		  printer driver file=/usr/local/samba/lib/printers.def
          # %h will expand to the Samba Server name
		  printer driver location=\\%h\PRINTER$
          printer driver = HP LaserJet 4

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

		[lp]
		   comment = My old printer laser
		   browsable = yes
		   printable = yes
		   public = yes
		   writable = no
		   create mode = 0700
		   printer driver=Apple LaserWriter

Driver Information For Autoloaded Printers

    The 'printer driver' can also be specified by information in the
    printcap file.  The printcap file must have the format:
     
    lw:driver=Apple LaserWriter
    hp:driver=HP LaserJet4

    The ':driver=' value is used as the name of the printer driver.
	
Details on the printers.def File Format
   By herb at sgi.com

For those of you who like to know the details, and in case I have guessed
wrong on some of the fields - The following is the format of the entries 
in the printers.def file: (entries are 1 single line - they are split here 
for readability)

<Long Printer Name>\
  :<Driver File Name>\
  :<Data File Name>\
  :<Help File Name>\
  :<Language Monitor Name>\
  :<Default Data Type>\
  :<Comma Separated list of Files>

The <Long Printer Name> is the name that is used to identify the printer,
and corresponds to the 'printer driver' entry.
The <Help File Name> and the <Language Monitor Name> can be empty.
If no <Driver File Name> or <Data File Name> are specified in the .inf file,
these will default to the section name for the printer.
The list of Files, are, of course, the device driver files.
The other fields are extracted from information in the .inf file.

The following is an excerpt from the MSPRINT2.INF file on a WIN95 machine.
I have deleted all but the entries relating to installing a driver for the
"QMS ColorScript 100 Model 30" printer. Using this "file" I'll try to 
explain how the printers.def file is created.

    ---------------------- Info from MSPRINT2.INF ------------------------
    ;
    ; The Manufacturer section lists all of the manufacturers that we will
    ; display in the Dialog box
    [Manufacturer]
    "QMS"
    ;
    ; Model sections. Each section here corresponds with an entry listed in the
    ; [Manufacturer] section, above. The models will be displayed in the order
    ; that they appear in the INF file.
    ; Each model lists a variation of its own name as a compatible ID. This
    ; is done primarily as an optimization during upgrade.
    ; name = installersection[,alternatename]
    [QMS]
    "QMS ColorScript 100 Model 30"    = QCS30503.SPD,QMS_ColorScript_100_Model_30
    ;
    ; Installer Sections
    ; These sections control file installation, and reference all files that
    ; need to be copied. The section name will be assumed to be the driver
    ; file, unless there is an explicit DriverFile section listed.
    [QCS30503.SPD]
    CopyFiles=@QCS30503.SPD,COLOR_QMS_100_30,PSCRIPT
    DataSection=PSCRIPT_DATA
    ;
    ; Copy Sections
    ; Lists of files that are actually copied. These sections are referenced
    ; from the installer sections, above. Only create a section if it contains
    ; two or more files (if we only copy a single file, identify it in the
    ; installer section, using the @filename notation) or if it's a color
    ; profile (since the DestinationDirs can only handle sections, and not
    ; individual files).
    ;
    [COLOR_QMS_100_30]
    QMS10030.ICM

    [PSCRIPT]
    PSCRIPT.DRV
    PSCRIPT.HLP
    PSCRIPT.INI
    TESTPS.TXT
    APPLE380.SPD
    FONTS.MFM
    ICONLIB.DLL
    PSMON.DLL
    ;
    ; Data Sections
    ; These sections contain data that is shared between devices.
    [PSCRIPT_DATA]
    DriverFile=PSCRIPT.DRV
    HelpFile=PSCRIPT.HLP
    LanguageMonitor=%PS_MONITOR%
    ;
    ; Color profiles go to the colors directory. All other files go to the
    ; system directory
    [DestinationDirs]
    DefaultDestDir=11
    COLOR_QMS_100_30=23
    COLOR_TEKTRONIX_200I=23
    COLOR_TEKTRONIX_III_PXI=23
    ; Localizable Strings
    ;
    [Strings]
    MS="Microsoft"
    PS_MONITOR="PostScript Language Monitor,PSMON.DLL"

make_printerdef is run with:
  make_printerdef MSPRINT2.INF "QMS ColorScript 100 Model 30" >>printers.def

The printer name is first found in the "Model section" to obtain the
name of the "Installer Section" (this is the name after the equal sign).
We ignore the alternate name.

The "Installer Section" contains entries for "CopyFiles" and "DataSection".
The "CopyFiles" line gives a list of all the required files for this
printer. If the name begins with an @ it is the name of a file (after
you strip off the @), otherwise it is the name of a "Copy Section" which
in turn is a list of files required. This printer has one file listed
"QCS30503.SPD" and two sections "COLOR_QMS_100_30" and "PSCRIPT". The
"COLOR_QMS_100_30" section is listed in the "[DestinationDirs]" as 
having a value of 23. This means that all files listed in this section
should go into the "color" subdirectory. The list of files to copy for
this printer is thus:

QCS30503.SPD,color\QMS10030.ICM,PSCRIPT.DRV,PSCRIPT.HLP,PSCRIPT.INI,
TESTPS.TXT,APPLE380.SPD,FONTS.MFM,ICONLIB.DLL,PSMON.DLL



More information about the samba-technical mailing list