C# – Building an installer that can install the same package multiple times (to different folders) with multiple configurations

cinstallationnetservicewix

We have a bit of an odd setup, which comes from the fact we provide hosted installations of our software to our clients, and each client may be on a different version of our software and be running with a seperate database.

We also allow clients (under a different licensing scheme) to install our software locally at their premises on their own machines.

This makes building a installation package MSI (we're using WIX) for one of our apps (a .NET windows service) fairly difficult, and I have one major stumbling block.

I can't figure out how to have one installer for a version (MyApp V2.0.0) that can be installed MULTIPLE times on one machine with the following properties:

  1. Name of app in add/remove programs: "MyApp (CUSTOMERNAME)", where CUSTOMERNAME is defined during the setup as part of a GUI.

  2. Each instance of the application installed into \Program Files\Company\MyApp (CUSTOMERNAME).

  3. A service created/updated called "MyApp (CUSTOMERNAME)".

  4. Allow individual installations to be upgraded without affecting other installations AT ALL.

Basically affecting the installation of one instance should not affect any others in any way.

Does anyone have any idea how this can be achieved or if there are any other available techniques?

Thanks.

Best Answer

Refer to the Microsoft documentation on Installing Multiple Instances of Products and Patches.

Basically, you can't do this at runtime "inside" the MSI (without breaking other core functionality of Windows Installer, in which case you might as well just use a non-MSI solution such as NSIS instead)

If you want to create a truly dynamic system, where multiple instances can be defined by the end-user at runtime you'll need to create a bootstrapper that prompts the user for information, generates an MST on the fly and then launches the MSI with the required parameters. Alternatively, create the MST's yourself on a per-customer basis (it's fairly trivial to script.. check out the samples provided in the Windows SDK)

From memory there was discussion on the WiX list last month with someone trying to do this when using WiX to install multiple websites on the same server. If you can find the relevant threads there should be some more through responses than mine there :)

Related Topic