Click here to Skip to main content
13,045,790 members (47,366 online)
Rate this:
Please Sign up or sign in to vote.

I have created a windows service application in c#. I want to create msi installer to install multiple instance of the same service application on the single project. For that I have added one dialog to take instance name at installation time from user.

At the time of fresh installation, all going well. But when I run msi installer second time with transforms(which is transforming productname & productcode and one added property MSINEWINSTANCE) using following command.

msiexec /I setup.msi TRANSFORMS=transformfilename.mst MSINEWINSTANCE=1

It is launching installer for new install. Installer takes parameters and finally installation process completed successfully,but It is not installing service application. Infect it is not invoking serviceinstaller class.

What is the thing I am missing ?

I really need this thing in my application. Please replay.

Thanks in Advance.

Posted 23-Jun-11 5:31am
SAKryukov 23-Jun-11 12:07pm
Why on Earth installing the same Windows Service twice? What is it supposed to do?
patel niraj 23-Jun-11 12:20pm
Hi SAKryukov,

My application is an connector between two system. And I want to make this connector running without interrupt. So I want to install all the connector service between different instances on the same machine(server).

Marcus Kramer 23-Jun-11 12:30pm
Why on earth aren't you using properly structured threading instead?
patel niraj 23-Jun-11 12:41pm
Hi, Marcus Kramer

All the instances need to have multiple different parameters, configuration files. And yes main thing is that, all the instances are for different parties. So it can be possible to configure accordingly and need to restart as per the client requirement.

videlin 23-Jun-11 15:33pm
Are you sure the name of the second windows service is different?
patel niraj 23-Jun-11 15:45pm
Hi videlin,

I am taking service name from user using custom dialog and setting service name in overridden method OnBeforInstall(). In second install installer taking service name,but it control is not reaching to the OnBeforeInstall method. Infect service installer class is not initializing.

Member 4267709 28-Sep-11 6:07am
Hi Niraj,

I am stuck in the same scenario as yours. Did you find a solution to do it?

videlin 23-Jun-11 16:02pm
I had some problems to fire a custom action when "everyone" is selected. It works with "just for me". Try to use "just for me" installation. Or select that option in the project (installAllUsers=False) if you don't want to show the radio buttons. And it is good idea to add "System.Diagnostics.Debugger.Break();" at the beginning of the custom action method (in your case OnBeforInstall()), so you can catch it when it starts.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I am not sure what you are trying to do is the best way to do it, will leave it with you.

However coming to the problem with the installer. I think in this case its best to use sc util with create command to install services.

For more details refer to How to create a Windows service by using Sc.exe[^][^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 23 Jun 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100