Deploying Canon print drivers with printer setups via Casper’s Self Service
In my shop, we use a number of Canon ImageRunner printers and have them set up in Casper’s Self Service so that our users can set them up themselves. All of the Canon printers in question have PostScript enabled, so I’ve been deploying the Canon PostScript drivers.
Historically, one of the things that was installed along with the drivers was a proprietary printing application that sat between the Mac’s CUPS printing system and the actual printer. That changed with the release of Canon’s 4.x PostScript drivers. With the new drivers, Canon has switched to using LPR and no longer uses that proprietary printing application.
Good news: Canon is no longer building in a custom printer program to handle talking to the printer; instead the new drivers are using LPR.
Bad news: Our existing printer setups that are available in Self Service do not work with the new printer drivers. I would need to delete and re-add our various printers to Self Service.
The bad news wasn’t a big problem by itself, but my testing showed that updating the printers in Self Service to accommodate the new printer drivers would make them no longer backwards-compatible with the old drivers. The new drivers would need to be installed in order for the new printers to work. Conversely, just pushing out the new drivers to our Macs could result in existing printer setups breaking.
In short, here were the problems I was looking at:
1. The old printer setups could not use the new drivers
2. The new printer setups could not use the old drivers
3. The new drivers needed to be installed before the new printer setup happened.
4. I didn’t want to break existing printer setups if I could avoid it.
Making the new drivers available in Self Service as standalone installers wasn’t an issue but I was concerned about adding them to the printer setups themselves. That potentially could result in the printer drivers being installed over and over again as people set up multiple printers on one Mac. I also wanted to avoid problems with accidentally trying to overwrite newer drivers, in the event that Canon released new drivers and someone installed them before I updated the driver installer in Self Service.
For details on how I addressed this, see below the jump.
Here’s the workflow I wanted to use when a Canon printer setup is requested via Self Service:
A. Casper will check the Mac to see if the needed Canon printers are installed.
B. If no Canon drivers or older Canon drivers are detected, the appropriate Canon print drivers will be installed before the requested printer is set up.
C. If the installed drivers are the same version or higher as the print drivers available via Self Service, no drivers are installed and Casper will proceed to set up the printer using the installed drivers.
The first part was figuring out if the needed Canon drivers were installed. Canon’s installer package didn’t have an easy way I could see to discern the driver version from the installer receipts, so I looked for something else that would have the version number. After some digging, I was able to confirm that the Canon CUPS PS Printer Utility application located in /Library/Printers/Canon/CUPSPS2/Utilities had the version number that I was looking for.
I also confirmed that I could use the defaults command to pull the version information from the CFBundleVersion key value stored in /Library/Printers/Canon/CUPSPS2/Utilities/Canon CUPS PS Printer Utility.app/Contents/Info.plist.
Using this information, I built the following script:
The script checks /Library/Printers/Canon/CUPSPS2/Utilities/Canon CUPS PS Printer Utility.app/Contents/Info.plist for the CFBundleVersion key value. Based on the key value, the following actions are taken:
- If the value returned is less than the version of the current drivers, the print drivers are installed by a Casper policy before the requested printer is set up.
- If the installed drivers are the same version or higher as the print drivers available on the Casper server, this information is logged and the Canon print drivers are not installed.
The driver version that the script is looking for is then set on the JSS by using Parameter 4 in the JSS settings for the script. As of 2-6-2014, the current version is 4.1.0.
The script uses a manual trigger to run a Casper policy that would install the print drivers. The next part was to build a policy which used that trigger.
Building the policy was straightforward, as I just needed it to respond to the manual trigger and install the package specified by the policy. When new Canon drivers come out, all I should need to do is update the policy with the new installer package.
Once I had the script and policy in place, I updated my printer setup policy with the new printer settings and added the previously-mentioned script. When added, I set the script to Run Before and set 4.1.0 in the Parameter 4 blank.
The other policy options were set as shown below:
The result is how it appears at the user’s end. When the printer setup is selected, the script will run before the printer setup and do its version check.
If new drivers are needed, a message will appear to inform the user that the drivers are being installed.
Once the printer setup has completed, a message will then appear to let the user know that the printer setup has completed.
One issue that this process does not address is the problem of existing printer setups. In the documentation for the new drivers, Canon noted that existing printers may need to be deleted and re-setup following the installation of the new drivers. Since the new drivers are now automatically installed on an as-needed basis by Self Service, existing printers may break.
That said, if all relevant Canon printers are registered in Self Service, the fix should be to tell folks with this problem to delete the non-working printer and set up the printer again in Self Service.