Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
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.
 
Niraj
Posted 23-Jun-11 6:31am
Comments
SAKryukov at 23-Jun-11 12:07pm
   
Why on Earth installing the same Windows Service twice? What is it supposed to do?
--SA
patel niraj at 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).
 
Thanks
Niraj
Marcus Kramer at 23-Jun-11 12:30pm
   
Why on earth aren't you using properly structured threading instead?
patel niraj at 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.
 
Thanks
Niraj
videlin at 23-Jun-11 15:33pm
   
Are you sure the name of the second windows service is different?
patel niraj at 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.

Thanks,
Niraj
Member 4267709 at 28-Sep-11 6:07am
   
Hi Niraj,
 
I am stuck in the same scenario as yours. Did you find a solution to do it?
 
Thanks,
Nikhil
videlin at 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
good
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[^]
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sc.mspx?mfr=true[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 CPallini 155
3 PIEBALDconsult 150
4 BillWoodruff 148
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 23 Jun 2011
Copyright © CodeProject, 1999-2014
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