jchristman
Pilgrim

MSI Multiple Instances

Need to be able to take my project (Basic MSI) and give it the ability to be installed more than once on the same machine. I know it can be done with an msi but can I do it in install shield 2008.

Here is the article I found that says it is possible.
(multiple instance support by using ProductCode changing embedded multiple instance transforms) http://blog.deploymentengineering.com/2006/10/multiple-instance-msis-and.html

I can not make heads or tells on this with my project. I build a single.exe and not an msi for the releases.
Labels (1)
0 Kudos
4 Replies
klacounte
Pilgrim

Re: MSI Multiple Instances

Check out this thread: http://community.installshield.com/showthread.php?t=169856&highlight=multiple+instance

I've implemented multiple instances, but didn't use the ISProductConfigurationInstance table because I needed more advanced functionality. My solution runs a vbscript to generate the transform and embed it into the MSI. If you're interested I can give you some details about it. One difference vs Christophers approach is that my MSI cannot be embedded into setup.exe.
0 Kudos
jchristman
Pilgrim

Re: MSI Multiple Instances

ok, I read thru the run msi multiple times, it kinda made since. :confused:

I think I would like to hear about how you did yours. 🙂

let me give you a breakdown of what I am trying to accomplish.

Installer needs to do the basic typical and custom installation, then with each new release it can just do an upgrade on the product. Now the catch, it needs to be able to be installed completely upto 6 times on the same machine, and each time they need to be able to perform the installation just like it was a new install or instance but it should alsocheck first though see if they would like to upgrade or modify any of the other instances isntalled.

Install 1 - complete
Install 2 - just option 1
Install 3 - option 1 and 3 but not 2

now when they run the installer it has to check these others and ask if you want to modify one of these or install another instance.
When an upgrade comes out it asks them to uprade one of these or do a complete install of another instance(for the complete package) and just asks them which instance they want to upgrade for the upgrade package. They also need to uninstall them one instance at a time if they so choose.
I have the package completed as far as doing and install, modifiying and the upgrade, but not for sure on how to go about getting the multiples done.

A good example of this scenerio whould be the istallation with SQL Server 2005.

Do you think this is possible Using a basic MSI?
0 Kudos
klacounte
Pilgrim

Re: MSI Multiple Instances

You can do this with a Basic MSI project. I have 5 projects, each install is part of a suite, that do exactly what you're trying to do - they even support 6 instances! 🙂

To start, the project must be setup to build uncompressed so that the MSI file is not embedded in setup.exe. So here's the process:

1) I build the project on the command line so the whole build process is automated.
2) After the project builds successfully a batch file runs that executes a vbscript once for each instance. The batch file has the product codes and upgrade codes for each instance as well as the instance names. The vbscript creates and embeds a transform that makes the following modifications to the install:
a) the package code get a new random GUID assigned
b) the instance name gets included in the ProductName property - "[ProductName] ([InstanceName])"
c) the product code gets assigned the value passed in
d) the upgrade code gets assigned the value passed in
e) IS_SQLSERVER_DATABASE gets the instance name included in
f) several other application specific properties get the instance name included in
g) the upgrade table gets updated with the passed in value
h) a CA gets created that modifies INSTALLDIR (type 51)
i) a CA gets created that sets a flag indicating whether INSTALLDIR was modified by the previous CA (type 51)
j) the CA's get inserted into the InstallExecuteSequence and InstallUISequence tables before CostFinalize. the CA's only get executed if "Not INSTALLED" and the flag has not been set
k) shortcut names get modified to include the instance name
l) certain registry keys get modified to include the instance name (Registry and RegLocator tables)
m) application pool names get modified to include the instance name
n) the IIS root folders get modified to include the instance name
3) Finally, the MSI is resigned using signtool.exe.

I don't have a custom setup launcher but I've considered building one. If I do, I will do it exactly how Wesley describes. It would be pretty simple to implement and you get to keep some of the good features in setup.exe like prerequisites. For now I just include a batch file for each instance that passes the correct parameters to MsiExec.exe to install the instance.
0 Kudos
klacounte
Pilgrim

Re: MSI Multiple Instances

One other important thing I forgot to mention when dealing with multiple instances. Because the component ID's are the same, some resources will not be removed when the instance is uninstalled. I wrote a CA that runs at the end of each install and will cleanup resources from components that were uninstalled. The ones I've noticed are shortcuts and registry entries. The CA just iterates the respective table and deletes the resource if present. I've filtered the registry cleanup to certain keys because merge modules and COM objects will also populate the registry table.
0 Kudos