I have a windows service executable that I know is written in .NET which I need to install under a different service name to avoid a conflict. The install doesn't provide anyway to specify a service name. If I only have access to the binary, is there anyway to override the service name when I install it with installutil?
I don't think there is a way.
I have done this before with a service I have written, but I had had to handle it myself in the code of the service installer. I passed in a /name
parameter to InstallUtil, and then used it in the installer (by getting it from the Context.Parameters
) to alias the service.
Unless the service you are using has this kind of functionality, it is not possible (certainly not using any documented feature of InstallUtil).
Try installing your service with sc.exe. A quick search will yield lots documentation. With that tool it's easy to modify existing services and/or add new ones -- including names.
Edit: I install my .NET services with this tool.
Do you have to use InstallUtil? Here are the commands to do what you want using sc:
sc create ahSchedulerService binPath="MyService.exe" DisplayName= "MyService"
sc description MyService "My description"
Reference: http://support.microsoft.com/kb/251192
Hi! I am a developer for an open source windows service hosting framework called Daemoniq. I understand how making a reusable windows service can be a bit of a pain using System.Service process. This is the reason why setting common service properties like serviceName, displayName, description and serviceStartMode is one of its features. You can download it from http://daemoniq.org
Current features include:
- container agnostic service location via the CommonServiceLocator
- set common service properties like serviceName, displayName, description and serviceStartMode via app.config
- run multiple windows services on the same process
- set recovery options via app.config
- set services depended on via app.config
- set service process credentials via command-line
- install, uninstall, debug services via command-line
Thanks!