I have a service that runs on the system in multiple instances. I need to find DISPLAY_NAMEservices from the service. I tried ServiceBase.ServiceName, but it returns (possibly) the name of the service from the project installer, which is at least in this case useless.
The service is installed installutilwith the parameter /name=.
Edit
I have a workaround based on the answer of Imran Balush. I read the name in the installer Me.Context.Parameters("name")and write it in the registry subkey ImagePathand read it using the Environment.GetCommandLineArgs service in the service.
IvanH source
share