views:

16

answers:

1

Hi, I have a dot net windows service project which contains multiple services. This has now reached our deployment engineer who installs all his services using an automated script. The script uses SC.exe to create the services, he doesn’t use intallUtil. Unfortunately, from what I can see, SC.exe only ever creates a registry entry for the first service it finds in the assembly, there doesn’t appear to be an option to specify individual services within the assembly. Apart from switching to intallUtil (he’s not keen) or splitting the assembly (I’m really not keen) what are our options?

Thanks for any help offered.

+1  A: 

You could write a custom installer using System.Configuration.Install.AssemblyInstaller.

Put some logic in Main(string[] args) to the effect all services are installed if, say, /i is passed in via the command line. Then the deployment engineer could amend his script to run yourservice /i instead of SC Create.

Noel Abrahams
Thanks, I managed to convince him to use intallUtil, but seems like a perfectly reasonable answer.
Vman