Add printer and scanner driver support
A new "driver" provider installs Windows printer and scanner drivers through the same catalog, UI and profiles as everything else: stage the package into the driver store with pnputil, then register it with the print spooler so it turns up in Add Printer. Driver names are matched by PREFIX against the names read out of the package's own INF files. Vendors stamp the version into the name -- "HP Universal Printing PCL 6 (v7.1.0)" -- so an exact name in a catalog goes stale at the next release, and a wrong one is unrecoverable without knowing what the package contains. When a prefix matches nothing, the error lists the names the package actually provides, which turns a dead end into a one-line fix. INF parsing handles what real files are, not what the spec suggests: Windows ships its own printer INFs as UTF-16LE and vendor packages follow suit, so reading them as UTF-8 finds nothing at all. Verified against every prn*.inf on a stock Windows install -- that test is what caught the encoding bug, since the hand-written sample parsed fine. Scanners are TWAIN/WIA rather than spooler drivers, so there is nothing to register: leaving driver_match unset means stage-only. Detection falls back to the uninstall entry, because a TWAIN data source has no spooler record. Packages come from a driver share rather than the web. Vendor URLs are version-pinned and several are EULA-gated, so nothing stable can be shipped in a catalog; a UNC path or local folder is used in place with no download at all, which is faster and is what a shop wants anyway. $DEPLOYR_DRIVERS names the share, and an unset variable is reported by name rather than surfacing three layers down as "no such file". Ships universal drivers for HP, Xerox, Ricoh, Sharp, Canon, Kyocera, Konica Minolta, Lexmark, Brother, Toshiba, Epson, Muratec and Zebra, plus scanner packages for the fi series, ScanSnap, Canon DR, Epson, Brother, Visioneer and Kodak Alaris. Profiles: @printers, @printers-all, @scanners. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7daceac077
commit
7ee270e128
14 files changed
+1738
-11
No files matched your search
@@ -0,0 +1,184 @@
|
||||
# Printer and scanner drivers
|
||||
|
||||
Deployr installs Windows printer and scanner drivers the same way it installs
|
||||
applications: pick them in the UI or name them on the command line.
|
||||
|
||||
```
|
||||
deployr install @printers
|
||||
deployr install hp-upd-pcl6 xerox-gpd-pcl6
|
||||
deployr install @scanners
|
||||
deployr status --catalog ... | findstr driver
|
||||
```
|
||||
|
||||
Under the hood it stages the package into the Windows driver store with
|
||||
`pnputil`, then registers the driver with the print spooler so it appears in
|
||||
Add Printer. Detection reads the spooler, so a run is idempotent even when a
|
||||
technician installed the driver by hand.
|
||||
|
||||
**This is Windows only.** macOS and Linux print through CUPS, where the driver
|
||||
is part of the queue rather than a separately installed component.
|
||||
|
||||
## Point it at your driver share first
|
||||
|
||||
Vendor driver packages are version-pinned (`upd-pcl6-x64-7.3.0.24923.exe`) and
|
||||
several vendors put theirs behind a click-through EULA, so there is no stable
|
||||
URL anyone can ship in a catalog. Mirror the packages on your own share instead
|
||||
— which is what you want anyway: a known-good version, on the LAN, at LAN speed.
|
||||
|
||||
```powershell
|
||||
setx /m DEPLOYR_DRIVERS \\fileserver\drivers
|
||||
```
|
||||
|
||||
Lay it out one folder per package, matching the paths in the catalog:
|
||||
|
||||
```
|
||||
\\fileserver\drivers\
|
||||
hp\upd-pcl6\ <- the extracted driver (the folder with the .inf in it)
|
||||
hp\upd-ps\
|
||||
xerox\gpd-pcl6\
|
||||
ricoh\pcl6-upd\
|
||||
sharp\ud\
|
||||
canon\generic-plus-ufr2\
|
||||
fujitsu\paperstream-ip\ <- an .msi is fine too
|
||||
```
|
||||
|
||||
A folder is preferred: `pnputil` stages it directly with no unpacking step. A
|
||||
`.zip` of the same folder works, as does an `.msi`. An `.exe` needs the vendor's
|
||||
silent switches in `silent_args`.
|
||||
|
||||
Check what a machine can see:
|
||||
|
||||
```
|
||||
deployr info hp-upd-pcl6
|
||||
deployr install hp-upd-pcl6 --dry-run --verbose
|
||||
```
|
||||
|
||||
If `DEPLOYR_DRIVERS` is not set, deployr says so by name rather than failing
|
||||
with a confusing "file not found".
|
||||
|
||||
## You do not have to type exact driver names
|
||||
|
||||
Printer driver names carry the version — `HP Universal Printing PCL 6 (v7.1.0)`
|
||||
— so an exact name goes stale at the vendor's next release. Deployr reads the
|
||||
model names out of the package's own INF files and matches on a **prefix**:
|
||||
|
||||
```yaml
|
||||
- provider: driver
|
||||
url: $DEPLOYR_DRIVERS/hp/upd-pcl6
|
||||
driver_match: HP Universal Printing PCL 6 # version suffix not needed
|
||||
```
|
||||
|
||||
If the prefix matches nothing, the error lists the names the package actually
|
||||
provides, so you can correct the entry without guessing:
|
||||
|
||||
```
|
||||
fail hp-upd-pcl6 no driver in this package matches "HP Universal Print PCL6";
|
||||
the package provides: HP Universal Printing PCL 6 (v7.1.0); HP Universal
|
||||
Printing PS (v7.1.0); ... and 3 more
|
||||
```
|
||||
|
||||
INF files are frequently UTF-16 and use `%token%` names resolved from a
|
||||
`[Strings]` table; deployr handles both.
|
||||
|
||||
## Scanners
|
||||
|
||||
Scanners are TWAIN/WIA rather than spooler drivers, so there is nothing to
|
||||
register — staging the package is the whole job. That is what leaving
|
||||
`driver_match` unset means:
|
||||
|
||||
```yaml
|
||||
- id: paperstream-ip
|
||||
name: PaperStream IP (Ricoh/Fujitsu fi series)
|
||||
categories: [scanner-driver]
|
||||
windows:
|
||||
sources:
|
||||
- provider: driver
|
||||
url: $DEPLOYR_DRIVERS/fujitsu/paperstream-ip
|
||||
kind: msi # no driver_match: stage/install only
|
||||
detect:
|
||||
registry: ["PaperStream IP"]
|
||||
```
|
||||
|
||||
Detection for scanners uses the uninstall registry entry, since a TWAIN data
|
||||
source has no spooler record. `paths` works too, for example
|
||||
`%SystemRoot%/twain_64/*PaperStream*`.
|
||||
|
||||
## What ships in the catalog
|
||||
|
||||
Printer drivers (`deployr list --category printer-driver`):
|
||||
|
||||
| Vendor | Entries |
|
||||
| --- | --- |
|
||||
| HP | `hp-upd-pcl6`, `hp-upd-ps` |
|
||||
| Xerox | `xerox-gpd-pcl6`, `xerox-gpd-ps` |
|
||||
| Ricoh | `ricoh-upd-pcl6`, `ricoh-upd-ps` |
|
||||
| Sharp | `sharp-ud` |
|
||||
| Canon | `canon-generic-plus-ufr`, `canon-generic-plus-pcl6` |
|
||||
| Kyocera | `kyocera-kx` |
|
||||
| Konica Minolta | `konica-universal-pcl` |
|
||||
| Lexmark | `lexmark-universal` |
|
||||
| Brother | `brother-universal` |
|
||||
| Toshiba | `toshiba-universal` |
|
||||
| Epson | `epson-universal` |
|
||||
| Muratec | `muratec-mfx` |
|
||||
| Zebra | `zebra-zdesigner` |
|
||||
|
||||
Scanner drivers (`deployr list --category scanner-driver`): `paperstream-ip`,
|
||||
`scansnap-home`, `canon-dr-driver`, `epson-scan2`, `brother-iprintscan`,
|
||||
`visioneer-twain`, `kodak-alaris-scanner`, `hp-scan-extended`, `sharp-twain`,
|
||||
`ricoh-twain`, `konica-twain`.
|
||||
|
||||
Profiles: `@printers` (HP, Xerox, Ricoh, Sharp), `@printers-all`, `@scanners`.
|
||||
|
||||
The `driver_match` prefixes are deployr's best guess at each vendor's driver
|
||||
name. The first time you run one, check the result — if the prefix is wrong the
|
||||
error tells you the right name, and you fix it once in an overlay.
|
||||
|
||||
## Site-specific printers
|
||||
|
||||
Most sites have one or two specific machines rather than a universal driver.
|
||||
Put those in an overlay next to the shipped catalog:
|
||||
|
||||
`C:\ProgramData\Deployr\catalog.d\acme-printers.yaml`
|
||||
|
||||
```yaml
|
||||
apps:
|
||||
- id: acme-frontdesk-mfp
|
||||
name: Acme Front Desk MFP (Ricoh IM C3000)
|
||||
categories: [printer-driver]
|
||||
windows:
|
||||
sources:
|
||||
- provider: driver
|
||||
url: \\acme-dc01\drivers\ricoh\im-c3000
|
||||
driver_match: RICOH IM C3000
|
||||
detect:
|
||||
printer_drivers: ["RICOH IM C3000"]
|
||||
|
||||
profiles:
|
||||
acme-onboard: [acme-frontdesk-mfp, chrome, adobereader, 7zip]
|
||||
```
|
||||
|
||||
Then any machine at that site is one line:
|
||||
|
||||
```
|
||||
deployr install @acme-onboard
|
||||
```
|
||||
|
||||
Note that the overlay's `url` points straight at the client's own server, so it
|
||||
does not need `DEPLOYR_DRIVERS` at all.
|
||||
|
||||
## Removing a driver
|
||||
|
||||
```
|
||||
deployr uninstall hp-upd-pcl6
|
||||
```
|
||||
|
||||
The spooler refuses to remove a driver a printer still uses, and deployr reports
|
||||
that plainly — remove the printer first.
|
||||
|
||||
## A note on where printing is going
|
||||
|
||||
Microsoft has been phasing out third-party v3 print drivers in favour of IPP and
|
||||
Mopria class drivers. Newer devices increasingly need no vendor driver at all,
|
||||
and Windows Protected Print Mode blocks them outright. This is for the fleet you
|
||||
still have to support, not the direction to build new sites in.
|
||||
Reference in new issue
Block a user