How to install a service with a description?

  • Thread starter Thread starter mdb
  • Start date Start date
M

mdb

When I'm using an Installer class to install my service, there doesn't seem
to be any way to provide a description. How can I accomplish this?

-mdb
 
Look at the code generated behind the Project Installer. Add this in
Public Overrides Sub Install(ByVal stateSaver As
System.Collections.IDictionary)



MyBase.Install(stateSaver)

Dim oKey As RegistryKey

Dim sValue As Object

Try

oKey = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\"
& Me.ServiceInstaller1.ServiceName, True)

sValue = oKey.GetValue("ImagePath")

sValue = sValue & " " & Me.ServiceInstaller1.ServiceName

oKey.SetValue("ImagePath", sValue)

oKey.SetValue("Description", "Stick your description in here!!")

End Sub
 
Back
Top