Cannot Install or Start a Windows Service

Printer-friendly versionPrinter-friendly version

Print Wizard has a feature whereby you can run print services either as a stand-alone Windows program (we call these Foreground Services) or as a Windows Service, always running and not requiring a user be logged in.

Most Print Wizard services, when run as a stand-alone program, are very flexible and are only dependent on the user that is logged in for security and permissions. However, a Windows Service runs in a more secure environment on Windows and is even more tightly locked down on newer versions of Windows, such as Windows Server 2008 or Windows Vista.

Service Name

  • A service name cannot contain certain special characters, such as #, ?, %, $, &, !, @ and others. When in doubt, do not include any questionable characters.
     
  • A service name MAY not be able to include a space. This depends somewhat on the release of Windows you are running on, but also the service pack installed. Again, if you do not need to, do not name a service with a space in it.
     
  • A service name cannot duplicate another service name. Part of the reason for not allowing special characters in names was to prevent "look-alike" names with hidden characters for this reason.

In many cases, Windows does not behave well if provided a name with invalid characters in it. One such case is on Windows XP if you try to install a service with a # in it. The following kernel.dll error dialog appears from Windows and the service fails to even install.

ServiceKernelErr

Again, a best practice is to not include any foreign or special characters in a service name.

Service User

Associated with each service installed on Windows is a default user. As an example, by default on Windows Vista a service runs as "Local System". Related to this user, is certain inherited permissions to be aware of.

  • On Windows XP, the "Local System" service is somewhat restricted in what it can do, whereas on Windows XP it is very restrictive.
     
  • Do not use mapped drives when running as a Windows Service. Not only does "Local System" not have access to mapped and shared network drives, but even a user may not gain access to these type of drives. Avoid them if possible. If you need to use them, set up the service to use a share name instead, such as \\server\my drive.
     
  • If you do have problems with a share, make sure the share does not require a log in. As a Windows Service there is no user-interaction and dialogs have no context in which to display themselves.
     
  • Do not set up a printer or other device that is not available to the user. As an example, if you are printing to a network printer, make sure that the network printer is available to all users. If you are running on Vista that means the printer would have needed to be installed not only by the Administrator, but installed with elevated privileges.

Administrative Access

Several Windows features can be an issue when installing a Windows Service. The biggest is not running as Administrator when you install or start a Windows Service. If you are going to use Windows Services, you must be logged in as Administrator. Along with this, there are a couple of other items that may come into play:

  • If you are running inside an active directories domain, group and user policies may prevent you from starting or installing a service. Check your domain server group and user policies, even if you are an Administrator.
     
  • If you are not running within an active directories domain, but are using group and user policies, make sure they allow services to be installed and started by the Administrator.
     
  • If you are running on Windows Vista or later, you must right click on the desktop icon for the Print Wizard user interface and select "Run as Administrator" to gain elevated privileges in order to install or start a Windows Service. Once done, you can then go to the Tools menu to manage the service.

Firewall, Network Devices and Port Access

If you are running an LPD service, a Listen service or an FTP despool service, the user or the application will need to be granted access rights to outbound and inbound traffic for the specific service or port. In most cases, you will not know that there is an error without reviewing log files for Print Wizard (since there are no interactive dialogs).

If a service fails to install or start, go to the user interface (desktop shortcut) and under the View menu turn on Debug and Messages and then retry. When it fails again, go to the View menu in the user interface and do a View Log to see why.

Several different applications can actually cause a problem here, not just software firewalls.

  • Windows Firewall in Windows XP, Vista, 7 & 8, Server 2003, Server 2008 all block the installation of a service if the installation is not run as Administrator. On Windows Vista and later, even if you are logged in as Administrator, you have to go one step further. You need to actually right-click on the desktop shortcut for the Print Wizard user interface and select "Run as Administrator". This will run with elevated privileges, above those of the user "Administrator" and will allow a service to be installed and started.
     
  • Windows Firewall in Windows XP, Server 2003, Server 2008 and Vista all block port access and the starting of a service if it does any network access. If you are logged in as Administrator and running with elevated privileges, you will be asked to allow this to start. In some cases, depending on your various security policy settings, you may just be denied.
     
  • Various Windows "Internet security suites", such as those from Symantec or Norton or MacAffee as part of their Internet anti-virus suite, will block any port access. You may need to add the Print Wizard service program as an exception to their "allowed application" lists.
     
  • Various third party firewalls may also block access to the network port, both inbound and outbound and either the network port will have to be opened or the application added to their application exception list.
     
  • If your network traffic will be going through various network devices, you may be blocked from any outside port access for those protocols needing it. Check with your network administrator.
     
  • If you are planning on printing across the Internet or over an Internet Provider link, they will most likely block this type of traffic. Again, check with your ISP or network administrator.
     
  • One other item that may seem strange - if you have any anti-spam or anti-adware applications installed, we have found some that will also watch network port traffic, kind of acting like a firewall. These likewise may end up disrupting or blocking network traffic for specific ports used.

The Print Wizard service application to use when you need to add it to a products "application exception" list is "pwservices.exe". Browse for it in the current installation directory for Print Wizard.

Network ports to allow depend on the service you are trying to run. Normally the LPD port is port 515, port 9100 for Listen, etc. Check with documentation and check your service setup for more information.

Because you are running under a "hidden" user, you may not see errors or dialogs. Check the log files produced by Print Wizard for any errors.

TESTING!

As with most things, it is important to test before installing. We highly recommend the following approach to setting up a service:

  1. Set up your service through the Print Wizard User Interface (PWUI) program's Tools menu.
  2. Run your service first as a stand-alone Foreground Service. You can start this type of service from within the user interface Tools menu - see "Foreground Service Wizard".
  3. Test your service in this mode first and make sure it behaves as you like.
  4. If all is OK, stop the Print Wizard Service and from the Tools menu, do a "Windows Service Wizard" setup for your service.
    1. Install the service.
    2. Run the service.
    3. Check the Print Wizard log files to see that it started up OK.
    4. Test it fully.

Review the items above if you run into any problems. You do need to remember what user a service runs as, what permissions it may or may not inherit and whether that service has network access through firewalls or other devices.

Conclusion

Windows Services for Print Wizard provide you an always active way to receive remote print jobs. As long as Windows is up, print jobs can be processed. But this also has some restrictions and some problems in detecting failures.

Make sure you test outside of a Windows Service before ever running as a Windows Service. This will prevent future headaches.

Likewise, keep in mind what is user specific about your service and what is global. This will also head off problems in advance.

 

Last review and update: Juy 8, 2014.