tnomore
Posts: 16
Joined: Wed Oct 31, 2007 5:14 pm

Same package supports multiple instances?

Hi.

I would like to use the same installer package to install multiple instances of a single service. Each instance should be separately available in the windows "services" panel and the "Add/remove programs" dialog (using a name that is supplied by the user).

The package installs some base windows service functionality, into which users can later upload (through a custom tool) individual WCF services.

I guess what would be required is the ability to alter the installer name/id at install time? I suspect this would difficult, at best. Is it possible?

brief example
package: base_service.msi

run #1: installs service named "service1"
run#2: installs service named "service2" (this does not try to upgrade/repair "service1", but installs a new service)

Some time later the user could, via "add/remove programs", remove "service1" while "service2" stays active.


thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
I would like to use the same installer package to install multiple instances of a single service.
This can be done by using the "Services" page to create multiple services which use the same EXE. We have a tutorial for installing a service, please take a look:
http://www.advancedinstaller.com/user-g ... rvice.html
http://www.advancedinstaller.com/user-g ... vices.html
Each instance should be separately available in the windows "services" panel
Since you will have different services in the "Services" page, each will be shown as a distinct service.
and the "Add/remove programs" dialog (using a name that is supplied by the user).
I'm afraid that this cannot be done with one installation package because it is not supported by Windows Installer. However, you can use multiple packages (one for each service) as prerequisites for the main installation.

You can read more about prerequisites here:
http://www.advancedinstaller.com/user-g ... requisites
http://www.advancedinstaller.com/user-g ... tware.html
I guess what would be required is the ability to alter the installer name/id at install time? I suspect this would difficult, at best. Is it possible?
I'm afraid that this is not possible because it is not supported by Windows Installer.
run #1: installs service named "service1"
run#2: installs service named "service2" (this does not try to upgrade/repair "service1", but installs a new service)
This is not possible because when you run an installed MSI it will automatically enter Maintenance mode (Modify, Repair and Remove options).

Note that what you need cannot be done with a single MSI package. The solution is to create a separate installation package for each service and add them as prerequisites to the main installation.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
p35t173nc3
Posts: 33
Joined: Wed Apr 02, 2008 1:20 pm

Ah man... Windows Installer doesn't have any support for named instances. In that case how would we go about spoofing support for it like SQL Server does?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Same package supports multiple instances?

Hi,

I'm not sure I understand what you mean. Can you please give me more details about this?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
p35t173nc3
Posts: 33
Joined: Wed Apr 02, 2008 1:20 pm

Re: Same package supports multiple instances?

Well basically when you install SQL Server, you can choose to install the 'default' instance or a named instance. Now I'm not sure if SQL 2005 still works the same way, but MSDE basically has one executable wrapper around 16 identical packages (just with different product codes). So in the end using the default MS redistributable you can only install a maximum of 15 named instances and the default one. This would be fine for me as long as I can keep the total size of the msi small enough to fit onto a cd with all our documentation, prerequisites and all (so under 400mb).

The reason for all this is that our product can be installed in different configurations.

1. Standalone - that is all components et al are installed as a singe product, with all prerequisites on the same box. Automatic upgrade will apply, although I'm not sure I like the sound of an uninstall running first I am sure I can get around this quite easily.

2. Intranet - where the different components are treated as separate products and each can have more than one (named) instance on the same box. I am not sure how I would go about upgrading the individual installations but I will cross that bridge when I get to it.

Also, I am planning on checking, and requiring, that the prerequisites are installed on the machine before running the installation and giving the user the option to install such prerequisites from the AutoRun application. For this I will write my own autorun if necessary.

Thank You
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Same package supports multiple instances?

Hi,
MSDE basically has one executable wrapper around 16 identical packages (just with different product codes).
I'm afraid that this is not the case. MSDE has only one installation package which can install multiple instances of the database server (which are basically services).
This would be fine for me as long as I can keep the total size of the msi small enough to fit onto a cd with all our documentation, prerequisites and all (so under 400mb).
Like I said in my previous post, I'm not sure what exactly you need to do. If you need to install multiple instances of a service then you can create each instance in the "Services" page. Basically you will install different copies of a service which use the same executable, but have different parameters.
Intranet - where the different components are treated as separate products and each can have more than one (named) instance on the same box.
This can be managed by conditioning the installation of the instances you created in the "Services" page. The condition can be a property set by a custom action which determines if a new instance will be created.
Also, I am planning on checking, and requiring, that the prerequisites are installed on the machine before running the installation and giving the user the option to install such prerequisites from the AutoRun application.
For this you can use the "CD/DVD Autorun" page in your Advanced Installer project (it is available only for Enterprise projects):
http://www.advancedinstaller.com/user-g ... torun.html

The Autorun EXE (which will be generated automatically) can point to the EXE bootstrapper of the installation package (which manages the prerequisites).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
p35t173nc3
Posts: 33
Joined: Wed Apr 02, 2008 1:20 pm

Re: Same package supports multiple instances?

Thank you Cosmin,
Just one thing though, using the method you describe to install multiple instances; I suppose that means that the installer won't be able to create a new folder, and I won't be able to upgrade individual services!?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Same package supports multiple instances?

Hi,

For upgrading a Windows Installer installation you have two options:
1) you use a full upgrade which removes the old version and installs the new one
2) you use a patch

In the first case, if a service has not been updated in the new package then the same version of the service is installed. However, if the service has been updated then the new version of the service is installed.

When using patches you can update only the services which have been modified in the Upgraded package and you can also install new services.
I suppose that means that the installer won't be able to create a new folder
This depends a lot on the way you organize and create your installation package (my suggestion from the previous post was just an example).

Another example is to create a feature for each instance of the server and use the Maintenance Mode (the Modify, Repair and Remove options) to install or remove an instance. Basically, you move the component of each service to a new feature and you set just one of the features to be installed (through the "Feature Properties" page). The other features can be set to not be installed by default, allowing the user to install them during the maintenance.

In this case the installation of the first instance is simple and it doesn't require something special. Also, through the "Modify" button on the "MaintenanceTypeDlg" dialog the user can choose to install other features (instances of the service).
I suppose that means that the installer won't be able to create a new folder
Note that the services use the same executable, but this executable must be installed for each instance of the service. Therefore, you need to have a copy of the executable in the "Files and Folders" page for each service you want to create. For example, if you want 10 instances of the service you can create 10 folders in the "Files and Folders" page, each containing a copy of the executable.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”