VCPService unit V2.0
---------------

THIS UNIT MAY BE USED BY ANYONE FOR ANYTHING WITHOUT CHARGE FOR FREE NOT HAVING TO PAY ANYONE ANYTHING FOR IT.

However, if you like it, you can email me and tell me about it. If you want, you can even give me money.

HISTORY OF SIGNIFICANT CHANGES
------------------------------
v1.2 Changed intallation parameters of service to accomodate start type (Automatic/Manual startup)
V2.0 Added Dependencies global string variable to accomodate dependency services. Alteration coded by Roger Fernando Reghin - Thanks

INSTRUCTIONS
------------

1. Create a new application
2. Remove Form1 (default form) from the project
3. Add the supplied form (uService.pas) to the project
4. Make uService Autocreate
5. In the project options, check the box labeled 'Generate console application'
6. View project source (View|Project Source)
7. Delete all the code in the main program block (ie in the Begin/end block)
8. Replace it with the line:

DoService(ServiceName, ServiceDisplayName)

where ServiceName is the name of the service as it is referenced by the SCM,
ServiceDisplayName is the name as it is displayed in the service manager and event logger.

9. Use the uService form as your main form, and develop you application from that point. Bear in mind that you can not display information on the screen, except by using the WriteLn command, which won't be seen anyway unless you have a console box open for the service. Compile your project when you're done.
10. Determine which services need to be running before the service can start (i.e. services upon which the service is dependent on). Add the dependencies line before the DoService command in the main program block. Dependencies must be separated by nulls. The following example sets the RASMAN (RAS Manager) and SQLSVR (MS Sequal Server) as dependencies:

Dependencies := 'RASMAN' #0 'SQLSVR'

11. Go into the command prompt, and run your service's executable with a /? parameter to see how to install or remove the service.

Comments? peter@interbill.co.za

