Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install windows service with custom name

I have an exe file with a windows service. To install it, i use the command:

installutil myService.exe /ShowCallStack

Then, i can see the "service1" listed in Services window.

My question is if it is possible to install 2 instances of same service (using the same exe) but with diferent names. I want to do that without changing the source code.

Thanks

like image 762
Zé Carlos Avatar asked Dec 23 '10 16:12

Zé Carlos


People also ask

How do I install a Windows Service with a different name?

You need to copy your service executable to a separate directory and use InstallUtil.exe to give it a different service name. From a command prompt, you'll need to use InstallUtil to install both instances of your service. For instructions on how to use InstallUtil, see Installer Tool (InstallUtil.exe).


1 Answers

Does your service have a ProjectInstaller class? If you add a ProjectInstaller to your service, then you can edit the DisplayName property of the ProjectInstaller's ServiceInstaller. This will change the name from "Service1" to whatever you want it to be. A walkthrough on ProjectInstallers can be found on MSDN here.

like image 85
AJ. Avatar answered Oct 20 '22 14:10

AJ.