0

We have a .Net service that we need to run more than once on the same machine. I have my exe and support files residing in 2 different folders: c:\folder1\ and c:\folder2\

But when I issue either of the following, the ServiceName does not change to what I want it to be:

"c:\folder1 - someId\install\InstallUtil.exe" /servicename="My Service Name 1" "C:\folder1 - someId\MyNameSpace.MyAppName.Service.exe"

sc create "My Service Name 1" binpath="C:\folder1 - someId\MyNameSpace.MyAppName.Service.exe" DisplayName= "My Service Name 1"

If no service has been created, the InstallUtil will register my service but not with the serviceName that I specify.

If a service is registered (for example folder1 service), then the InstallUtil will error on the folder2 registering with a "specified service already exists".

The sc command only shows the help info for the sc command as if I have the wrong syntax.

What is the proper way to register the same service multiple times on the same machine?

Richard-Degenne
  • 2,892
  • 2
  • 26
  • 43
Jerry
  • 6,357
  • 8
  • 35
  • 50
  • Are you giving it a different name for folder2? – Scott Chamberlain Oct 12 '16 at 20:19
  • Do you have the service name embedded programmatically anywhere? – David W Oct 12 '16 at 20:20
  • InstallUtil.exe itself has no use for an /servicename option. Your own [Installer] is supposed to use any additional options, available through the Installer.Context property. We can't see what your Installer class looks like but it is kinda guessable. – Hans Passant Oct 12 '16 at 22:50
  • My exe has same name in each folder. I'll look at the Installer.Context property. – Jerry Oct 13 '16 at 01:28

0 Answers0