Where to define Service Decription for my service program?

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi,
I wrote a Windows Service with C#. I can set Service Name for my service.
But where should I define Service Decription for my service?
Thanks in advance.
David
 
David said:
Hi,
I wrote a Windows Service with C#. I can set Service Name for my service.
But where should I define Service Decription for my service?
Thanks in advance.
David

There is no property/method/anything-else to set the description for a
service. You have to create a registry key in
HKLM\SYSTEM\CurrentControlSet\Services\<name_of_your_service> and then add a
string value to that key called "Description". You can handle this during
installation of the service by writing a customer installer class (inherit
from System.Configuration.Install.Installer) and handling the "AfterInstall"
event. You should also handle the "AfterRollback" event to remove the key
just in case the installation fails.

Good luck,
Ryan LaNeve
 
Thanks.

Ryan LaNeve said:
There is no property/method/anything-else to set the description for a
service. You have to create a registry key in
HKLM\SYSTEM\CurrentControlSet\Services\<name_of_your_service> and then add a
string value to that key called "Description". You can handle this during
installation of the service by writing a customer installer class (inherit
from System.Configuration.Install.Installer) and handling the "AfterInstall"
event. You should also handle the "AfterRollback" event to remove the key
just in case the installation fails.

Good luck,
Ryan LaNeve
 
Back
Top