Registering / Unregistering a Managed Service

Registering a Service

As you might have already found out, the class ServiceApplication offers the methods RegisterService and UnRegisterService.

Registering a Service is an optional feature, which has been included.
Executing this method will write service specific information to the registry.
registry.png
Example:
[HKEY_LOCAL_MACHINE\Software\ManagedServices\60047b27c0c949d3869cb11a124ddb3b]
"ServiceState"="Running"
"Executable"="\\Program Files\\ManagedServiceSample1\\ManagedServiceSample1.exe"
"StartType"=dword:00000001
"ServiceName"="CallLoggerService"


If not existing, an new Registry will be created under HKEY_LOCAL_MACHINE\Software\ManagedServices\. This is the basic key for all registered managed services.
This registry key creates a new service specific subkey. The name of the key is equal to your Services Guid.
ServiceState reflects your actual Services state. If it is changed to any other state and the Service has been registered before, the value will be changed as well in your registry. This helps external applications to monitor your service.
Executable contains the location of your services within the filesystem.
StartType shows, if the Service is to be started automatically (1) or manually (0). This information is used by the Managed Services launcher, which is part of the 1.0 Alpha 2 release.
If the property StartType of your Service is changed, and the Service has been registered previously, the value gets changed within the registry automatically.
The value ServiceName reflects the according named property within your Service.

Unregistering a Service

If a Service has been previously registered, the registered information gets deleted from the Registry.

Last edited Jun 5, 2008 at 8:19 AM by PeterNowak, version 5

Comments

Hemaivvala Jun 30, 2009 at 7:18 AM 
Hi ......
I have created a service and installed on Mobile successfully but i didn't get any entry at HKEY_LOCAL_MACHINE\Software\ManagedServices\.
Please tell me the solution.There is no way to debug also.I am helpless.Please help me