473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Multiple Instances of a Service on 1 box

Hi,

I am trying to create a Windows Service in C# that will install on a single box to support multiple environments. I have created the service and it works perfect. Now however, the client has decided to run multiple environments of the application (a web app) on the one box (i.e. production, acceptance & training). The problem is that the service also needs to run in each environment with it's own configuration settings.

I found an article from this newsgroup from Patrick Lam (MAY 2002) that sounded like it was what I needed but couldn't really get it to work. Is there any examples of how I could modify my existing service code so that the name of the service etc is something I can have entered during the installation process and that information is configured dynamically etc so that multiple copies of the service installation exe's are put into seperate directories and therefore can be totally independant of one another. That way the acceptance environment can be updated with the newer version without affecting production and vice versa.

This way I would run the setup package enter a name (e.g. "Production") and get something like:
Processor Service - Production

installed on the box.

I could then run the setup package again, not get told the product is already installed, and enter another name (e.g. "Acceptance") and end up with:
Processor Service - Acceptance
Processor Service - Production

listed in the Services manager.

Effectively what I want to end up with is something very much like SQL Server 2000 where each service can be stopped and configured and upgraded individually. Therefore, I would also need to be able to remove the indivdual services as well if required.

Will try anything at least once.

FYI: I am using VS2002 EA, Framework 1.0 SP2 and the standard included installer solutions.

Thanks,
Mark
Jul 21 '05 #1
4 1723
Hi Mark,

Thanks for posting in the community.

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #2
Hi Mark,

Thanks for posting. I have briefly reviewed Patrick Lam's post. I believe
the story is not that simple.

If you would like to use Setup project to deploy the Service, you have to
make use of MSI transform, since we cannot install the same MSI package on
one system multiple times (per machine or for the same user).

http://msdn.microsoft.com/library/de...us/msi/setup/t
ransforms.asp?frame=true

If we take a detailed look on the MSDE setup program, we can find 16 MSI
files. They correspond to the 16 (maximum number) instances of the MSDE.
When we launch the bootstrap EXE ("Setup.exe") the correct MSI is picked
and used.

I hope the information is useful to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3
Hi Felix

Thanks for the info. I have read the articles on transformations and completed the samples, but now have some questions

I have created the MNP2000.msi and MNP2000t.msi databases and the associated MNPTrans.mst file by doing the example

http://msdn.microsoft.com/library/de....asp?frame=tru

I have now tried to install this sample to simulate the multiple environments I am going to need for my Windows Service installation, but I have found that the result is I can only effectively install it once. The transformation works and I end up with a slightly different version than using the base database to install the product, but I cannot install both versions at the same time. If I run the installer using the command line

msiexec /i MNP2000.ms

I end up with a default installation of the sample ap

if I then run (as specified in the article)

msiexec /i MNP2000.msi TRANSFORMS=MNPtrans.ms

I do not get the fresh installation screen as I expected but the Repair, Modify, Remove window

I have tried modifying the product name of the package (MNP2000t.msi) and supplied some new guids and this then enabled me to run the separate packages and install it twice, but I couldn't run it applying the transformations to MNP2000t.msi. I am now wondering if I am doing what needs to be done, or am I in fact simply hacking the database and possibly digging myself a very deep hole

Is there any information available on what I am trying to do or what is in the MSDN Library it? Also, the sample relies very heavily on the SDK and the tools assocaited with that (i.e. Orca and MsiInfo), is there a way to do this using the Windows Installer features in the VS IDE? Do third party products like WISE or InstallShield have support for these types of installations

Thanks
Mar

Jul 21 '05 #4
Hi Mark,

Thanks for your feedback. In fact, Transform may be necessary but not
sufficient to achieve the goal.

Transform can change the installation database and tables. However, it
cannot modify the summary information stream. In order to achieve the goal
of multiple installation. We need to change at least 2 things in the MSI,
the product code and the package code. It is likely that we need to change
the upgrade code as well. Through applying a Transform, we can modify the
ProductCode and the UpgradeCode properties in the "Property" table.
However, the PackageCode is stored in the summary information steam, which
is not modifiable solely with Transform.

I would still suggest that we make reference to the MSDE installation
program, which uses 16 separate MSIs. As far as VS.Net Setup project is
concerned, we have the option to package files "As loose uncompressed file"
or "In cabinet files" (in the project property settings). As a result, we
only store the basic database information in the MSIs and we can re-use the
external files for different MSIs.

If you would like to run multilple .Net Windows Services, I think we cannot
hard code the service name in the ServiceInstaller class. Instead, we may
need to read the service name from an external source, so that it is
configurable. The service name is used to identify the service under the
regsitry key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi ces\".

I hope this helps.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nigel | last post by:
Has anyone got any links to sites, articles etc or can help with how to write a Windows service that supports multiple instances in the way that MS SQL does? (I have an existing service and just...
1
by: Vlad | last post by:
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...
11
by: Mike | last post by:
Looking to find any information on how to properly configure multiple instances of DB2. This is on Win2k db2 ver 7.2. I am basically looking for information on how the multiple instance settings...
4
by: Jeff | last post by:
We have multiple ASP.Net web apps in development. As a standard we are looking to go with SQL Server to hold state information. Can we have the multiple apps all point to a single State DB? Or...
10
by: John | last post by:
I currently have a Windows Service that runs Transactions that are very Processor/Memory Intensive. I have a requirement to deploy multiple instances of the Web service on the Same server. Each...
1
by: sunil | last post by:
Hello All. I have written a program as an exe that performs some kind of order processing. The program is first configured and then started manually. I have have multiple instances of this...
0
by: Sunil Pandita | last post by:
Hi all, I have created a windows service that is working well. Now i want to create the multiple instances of this service on the same box. How could it be possible?. One way that I thought...
7
by: Matt | last post by:
I have approximately 5 instances on my test server that are identical to my prod server. On the prod server, when I look at the services file, there is a single entry per instance and everything...
1
balabaster
by: balabaster | last post by:
Hi, I'm trying to figure out how to install multiple instances of a Windows Service on a single machine using the deployment Setup Project. We have a Windows Service that's configurable through...
0
by: jigsmshah | last post by:
I have a windows service developed in C#.I am reading the connection string from an ini file and also i am reading 3 image file from the bin directory. now the new requirement is that there will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.