7

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?

Don Vince
  • 185
  • 1
  • 6

5 Answers5

16

Virtualise, seriously

Chopper3
  • 100,240
  • 9
  • 106
  • 238
5

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.

EBGreen
  • 1,443
  • 11
  • 10
5

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.

Gili
  • 295
  • 1
  • 4
  • 20
mctsonic
  • 437
  • 2
  • 4
5

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:

Stein Åsmul
  • 2,566
  • 4
  • 25
  • 38
  • Very thorough answer. Never heard of _instance transforms_ before, so that was very useful. I think it might be the actual answer here? As you said, it was devised to accomplish exactly what the OP asked. Do you have any reasons to "not trust" msi here? It's a very old and stable system, this must have been exhaustively tested by now. – julealgon Feb 03 '14 at 14:11
0

The thing that stops you installing it twice is the ProductCode Guid if you change that it will remove the "this product is already installed" message and let you install. That is what an instance transform is doing but you can do the same by opening it in Orca and changing the productcode in the property table.

Obviously even if you do hack it to install twice you want to make sure you aren't overwriting in the same locations.