I want to install an MSI twice

I have a peculiar wish to install an msi twice on a machine. The purpose of the double install is to first install under the pre-production folder, run the deployment in a safe environment prior to deploying in the production folder.

We typically use separate machines to represent these different environments however in this case I need to use the same box.

The two scenarios I get are as follows:

  • I've installed pre-production, I'm happy, I want to install production, I run the msi, it asks whether I want to repair or remove the installation
  • I've production installed, I want to install the new version of the msi, it tells me I already have a version of the product installed and I must first un-install the current version

The first scenario isn't too bad as we can at that point sensibly un-install and re-install under the production folder, but the second scenario is a pain as we don't want to un-install the live production deployment.

Is there a setting I can give to msiexec that will allow this?

Is there a more suitable different approach I could use?


Solution 1:

Have a look at what Scott Willeke's Less Msiérables (LessMSI) can do for you ...

http://lessmsi.activescott.com/

Use it to extract and change guids and/or contents of MSI, repackage and execute your 'install twice' need.

Solution 2:

Virtualise, seriously

Solution 3:

It is not possible to install the exact same MSI twice. You might be able to open the MSI and change the GUIDs to get it to install a second time. Be aware that this way there be dragons. Unless you are exceptionally lucky or the install/product is exceptionally simple, I can almost guarantee that not only will your second install not work, most likely you will break the first install too. I would highly recommend working out whatever issue makes you think it is necessary to use one box.

Solution 4:

Windows Installer has a built-in feature that is supposed to allow what you want to do: "Instance Transforms", but despite all my MSI experience I haven't used it much. It allows you to install the same product several times via the MSINEWINSTANCE property and a transform set at the command line.

If this is a third party application, I would go for the virtualization approach that has already been recommended. You should be aware that you can virtualize the packages using Microsoft App-V virtual packages or just use regular VMWare or Virtual PC implementations (virtual PCs as opposed to virtual packages).

Microsoft App-V virtual packages and new virtualization technologies allow a few new things compared to a normal application:

  • Application streaming - no local installation on machines - JIT
  • Use two incompatible software on the same computer
  • Updating through the server
  • Control licensing - max simultaneous users or tie software to a group / user.
  • Present the application quickly and easily to users
  • More Microsoft marketing here.

If this is an internal application where you can have a dialog with the development team, a viable solution is to build a second dev MSI that installs the pre-release version side-by-side with the production version. These MSI files will then need to be authored to be able to co-exist in a civilized manner. This is quite involved actually - and involves things such as not fighting over the same file associations, not registering system-wide COM components from different locations, not overwriting each other's registry keys, not using the same shortcuts, not overwriting each other's settings files (text, xml, ini, etc..). There are many challenges.

Finally, and the approach we generally choose, we can have the MSI install a different config based on parameters passed to it. So you can have a property called CUSTOM_ENVIRONMENT = "DEV" to install a test instance of your application. This approach relies on a single MSI capable of installing itself in different flavors - though - and hence does not appear to match what you are asking for.

So in summary (in order of my subjective preference):

  1. Virtualize - I like the fact that this sort of removes the whole problem.
  2. Side-by-side install: (Multiple MSIs PROD / DEV / UAT capable of side-by-side co-existence (Internal app only)
  3. Instance Transforms? (as I said, haven't used it - but this is what it is supposed to help for)
  4. Environment aware MSI (Single MSI capable of installing as PROD / DEV / UAT) (Internal app only)

Some Links:

  • Installing Multiple Instances by different msi having same Package Code
  • How to prevent Wix from installing an older version?
  • WiX generating new upgrade code
  • Windows Installer-Avoid FileinUse dialog box when Installing a package
  • How can I find the Upgrade Code for an installed MSI file?
  • Detect side by side installations?