"Vlad" <RE***************@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is there any way to install multiple instances of the same windows service
designed with VS.NET 2003? I tried copying the binaries into a separate
folder and then copying registry entries for the original service under a
new name but the SCM complains that the executable does not have this
service implemented.
Please note that I need to have distinct instances of executables
installed not merely multiple windows services defined within the same exe. - I know
how to do that.
The problem is that I do not know at compile time how many instances of
the service is going to be installed. Also each instance will have a distict
config file with distinct settings. Because config files are bound to the
exe I could not have multiple config files used by the same exe's services
in that scenario.
Yes, you can do this, but it's a nasty hack.
Whatever you want to be different between the instances has to be configured
from a config file. This includes the ServiceName and DisplayName. You'll
probably have other things which need to vary by instance, like port
numbers. Set those to come from the config file as well.
Create separate directories for each instance. Copy all necessary binaries
there, as well as the <service>.exe.config file.
Now, the problem is that if you run installutil on each of these instances,
they will not install. installutil will know nothing about your
<service>.exe.config. In fact, like all other programs, installutil will
only know about installutil.exe.config.
So, you have to copy <service>.exe.config to be installutil.exe.config.
Also, since installutil will only see installutil.exe.config in the
directory it's running from, you'll have to copy installutil.exe to the
instance directory, then run that particular installutil.exe.
--
John Saunders
johnwsaundersiii at hotmail