cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
san_bsw
Level 3

Install the same service multiple times under different names

Hi,

I am using the InstallShield 2012 Premier Edition. I have a Basic MSI project where I install a service.
The user can set how the service should be named with a custom dialog.

Now I want to install the service multiple times under different names by starting the same setup again.

How can I accomplish this task?

Thanks in advance
Christoph
Labels (1)
0 Kudos
(2) Replies
san_bsw
Level 3

How can you install a Basic MSI setup multiple times? An answer to this question would solve my problem I think.

EDIT: I have managed to install a Basic MSI setup multiple times by adding instances in the "Multiple Instances" tab.

But now I am still having problems installing the windows service multiple times. It seems that the service always gets overwritten by the latest installation.
What makes the windows service unique? Is it the "Component Code" of the component or the "Key Name" of the windows service?

Thanks in advance
Christoph
0 Kudos
Kelter
Level 10

Some of this might be of interest to you if you want to avoid transforms (finite number of instances) and just let the installation run like new every time you launch it. Keep in mind that this solution would require you to come up with your own way to uninstall:

Adding and Removing an Application and Leaving No Trace in the Registry

What makes a windows service unique is the service name. This is quite literally a namespace issue. If you want your install to be super dynamic, you could write a custom action that modifies the msi at runtime. You would want to maybe create a loop to query the SCM for ServiceName, and when you find a value for n that is not already in use, change the name of the service in the ServiceInstall table to that name, and then continue as normal.

That said, on each of these installations, are you installing a new set of files, or is this just to create multiple instances of a service from the exact same set of files? If it is the latter, then I think you're going about it all wrong. Adding instances of the service is something that could more easily be integrated in a GUI provided by your product rather than the installation itself. So I would say, install the product with the initial copy of the service. Write a quick little gui or command line app that creates new copies of the service. I've seen this done inside the service executable itself, calling it with a "--install" argument tells it to find a unique name for itself, and create a new service instance. If this is a .NET service, maybe look into TopShelf. That's what the devs use here.

The trick then is to make deleting one service delete all the other ones. I'll leave that up to you.

I hope I have given you enough information to solve the problem a couple different ways.

Good luck!
0 Kudos