Easy way to Install Printers on Windows XP
Background
Every printer and most fax machines purchased during my tenure at Air Power have featured an internal print server and Ethernet jack enabling them to be plugged into our network. All "personal" printers were retired as they ceased to function and not replaced. Instead of each employee printing to a local printer physically attached to their computer, they are expected to print to a nearby network printer. This has enabled us to save money on supplies, maintenance, and on the printers themselves.
All end-users using Windows XP are configured to run in a "Limited User" profile. This prevents end-users from making configuration changes or installing applications - both malicious and needed. The installation of printers on Windows XP has always been a bit puzzling. If you have a printer physically attached to the computer you cannot install a "local" printer. However, XP will allow you to install a printer shared on a network - installing the drivers and configuring Windows. However, a network printer utilizing TCP/IP, like a local printer, requires administrative priviledges.
Microsoft has created a utility to install printers remotely from a command prompt running as a domain administrator using the "rundll32 printui.dll,PrintUIEntry" command. This command can be run from one PC pushing the install of new printers onto client PCs. However, network printers require a change to the registry which cannot be done remotely (unless done manually via regedit) and then restarting a Windows service.
Creating an installer gets around this and other issues, such as firewalls, by running on the local machine with Administrator rights.
Installing network printers requires three steps:
- Add TCP/IP ports to Registry
- Restart Print Spooler to use new ports
- Install printers (drivers and entries into Printers Folder)
The Challenge
Create a setup program like you find with most applications that an end-user can run that will install all networked printers. Printers added should appear in the Windows XP Printers folder with names and descriptions to easily recognise the printer and it's location. The installer needs to accommodate the installation of several brands of printers on different networks and subnets. Above all the installer must be easy to execute by the end-user requiring as little input as necessary.
The Solution
Using the open-source Nullsoft Scriptable Install System (NSIS) I created an executable which the end-user can run using Windows' "Run As..." feature. A domain administrator account was created just for end-users to install applications. The end-user just needs to contact an administrator to get the password. I posted this executable with instructions on how to use it on our intranet. The end-user can download this executable and re-install all network printers. When a new device is added I edit this executable and post a comment on the intranet letting people know there is another printer on the network.
The Result
The benefits are lost to most end-users but, for admins and certain end-users that routinely install printers the benefit is immediately recognized. With just a few clicks of a mouse and entering a password all networked printers in all locations can be installed in a minute or two.
When printers are replaced the installer is updated to remove the old printer and install the new printer. One problem to overcome is setting a Default Printer. For now, the end-user is instructed to set the Default Printer after closing the setup application.
What was learned
How the open-source solution NSIS can create powerful applications by using a simple scripting language that can be compiled into an executable. Coupled with obscure Windows utilities one can get around most obstacles related to limited user permissions on an NT domain. As a result, of this exercise other executables have been created to address minor problems with limitations imposed by Windows.
Additional Resources
Sourceforge wiki page I created with the NSIS script used.
September 2005