[fpc-pascal] Trying to register a Windows Service gives error

Graeme Geldenhuys ggeldenhuys at qts.co.uk
Mon Oct 6 12:59:19 CEST 2014


Hi,

I created a relatively simple Windows Service Application using FPC
2.6.4. The application imports CSV data from a monitored folder and
updates product tables in a MS SQL Server database.

The Service Application installed and ran perfectly on my Windows 7
workstation. It also installed and ran perfectly on our Development
Server (Windows 2008 R2 SP1 64-bit).

But when we deployed the application to our client's test server (also
Windows 2008 R2 SP1 64-bit) we got the following error trying to
register the service.

==============================================
C:\Q-Point\csvimporter>csvimporter_service
Usage: C:\Q-Point\csvimporter\csvimporter_service.exe [command]
Where command is one of the following:
  -i --install   To install the program as a service
  -u --uninstall To uninstall the service
  -r --run       To run the service

C:\Q-Point\csvimporter>csvimporter_service -i
exception at 0042CD50:
System error, (OS Code 5):
Access is denied.
.

C:\Q-Point\csvimporter>
==============================================

Immediately I thought we don't have enough permissions on the client
test server. The client came back and said the user we are using is an
Administrator user. So permissions shouldn't be a problem. :-/

Any thoughts on what it could be?


More details on the application:
--------------------------------
The application is based on the daemonapp.pp unit - part of FCL-Extra.
I've followed Michael van Canneyts "daemon.pdf" article to the letter. I
created the application, created the daemon thread etc. As I mentioned,
it works fine on my workstation and on our development test server. But
doesn't install on the client's test server.


I Googled the error and came across a FPC-Pascal message from 2011.
[http://lists.freepascal.org/pipermail/fpc-pascal/2011-October/030464.html].
But in that discussion the developer tried to query the Windows Services
by instantiating a TServiceManager instance. In our case we are using
the daemonapp unit instead.

Any help would be greatly appreciated.

Regards,
  Graeme




This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions are solely those of the author and do not necessarily represent those of Quality Technology Systems Ltd. If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. If you receive the message in error, please immediately delete it, destroy all copies of it and notify the sender. Internet email is not a totally secure medium and therefore Quality Technology Systems Ltd does not accept legal responsibility for the contents of this message. We have taken steps to ensure that this email and any attachments are free from viruses. However, we cannot accept any responsibility for any virus transmitted by us and recommend that you subject any incoming email to your own virus checking procedure. Registered in England No. 3208823



More information about the fpc-pascal mailing list