2

How can I install same windows service in different Service name as it has to point to a different database on the same machine.

Is there a way I can do without having to rebuild the project and change the name in Service installer?

Thanks in advance

acadia
  • 2,619
  • 18
  • 55
  • 72

1 Answers1

1

The service name is a string. You can pass it as a parameter to the installer and install the same service multiple times using the parameterized service name.

Here's an abstract base class we use for service that includes a code based installer. You can adapt this to parameterized service name easily.

Converting a c# commandline app to a Windows service

Community
  • 1
  • 1
Samuel Neff
  • 73,278
  • 17
  • 138
  • 182
  • 1
    Well...isn't that nifty. And here I was changing the name in the service and rebuilding. I should have asked this question myself! ;) – NotMe Aug 28 '13 at 01:58