Let me clarify myself.

I want
1) N distinct Windows 2000 Services wih N distinct service names
2) One Project installer .vb (and .resx) file.
3) ONE Service .vb  and .resx file.
4) One Visual Studio VB .Net project

I have now managed to do the following:
1) Created multiple copies of the .vb and .resx file for my Service
1.1) Removed the main method in all but the first Serivce .vb file
1.2) Modified the Main method of my first Service .vb file to do
    ServicesToRun = New System.ServiceProcess.ServiceBase() {New MyService
(), New MyServiceA(), etc etc. etc.}

2) Added ServiceInstallers for MyServiceA....MyServiceZ

What I want is to to be able to 'dynamically' create MyService{A-Z} (and
dynamically add Installers in ServiceInstaller .vb file).  The ticky bit is
that in the main method of the first service, it instantiate the services
MyService{A-Z}, and I don't want to have to copy and paste and modify
MyService, renaming to MyService{A-Z} within the file, if you see what I
mean.

If anyone could help, please reply to the mailing list.


>Basically, I need to do the same thing as Per.  i.e., I want N different
>services, all pointing to the same executable (which implements the same
set
>onStart, onStop, etc.)
>
>I don't quite get however, what to do about setting Service Name in the
>Main() of the Service's VB file and its associated ProjectInstaller (it
this
>what is being talked about here??).
>
>What I mean is that  I have a service, called MyService defined within
>MyService.vb (one instance, one name for now), and such a Service has a
Main
>method which gas the following
>
>        ServicesToRun = New System.ServiceProcess.ServiceBase() {New
>MyService ()}
>        System.ServiceProcess.ServiceBase.Run(ServicesToRun)
>
>Next, I have my ProjectInstaller.vb (added by clicking on the link Add
>Installer) in the service's design view.  It has the following line:
>
>        Me.ServiceInstaller1.ServiceName = "MyService"
>
>        'ProjectInstaller
>        '
>        Me.Installers.AddRange(New System.Configuration.Install.Installer()
>_
>                {Me.ServiceProcessInstaller1,Me.ServiceInstaller1, })
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to