1

How can I create an MSI Installer which lets the user decide whether a previous version should be retained or not?

I've set the current installer's UpgradeCode to be the same as the previous version, as I've read in an article.

I've tried setting RemovePreviousVersions to True but it uninstalls the previous version silently; is there any way to make the user decide about it?

The idea is, the user should be able to:

  • Install the latest software version
  • Install the latest software version over a previous one
  • and lastly; Install the latest software version side by side with the previous one.

Update

Just an info, I'm not knowledgeable of the tools, I'm just trying out Installer Project, but I'm willing to learn another tool if necessary, as long as the output is an MSI.

Update#2

I was able to do it in Advanced Installer but it is a paid feature, so... I'm thinking maybe I can also do it in Installer Project or something. Anyone?

Wreigh
  • 3,215
  • 16
  • 37
  • Is it the solution you want to get like Stein's suggestion? Would you please share the latest information in your side? – Jack Zhai Aug 27 '18 at 03:00
  • sorry for the late reply, I will reassess the situation and update my question if necessary. as for now, what's in my question is what I need to happen. – Wreigh Aug 28 '18 at 00:37
  • It looks like **Advanced Installer** uses the **multi-instance transform feature** to accomplish their support for multiple installation instances. This is advanced indeed. I have mentioned this concept in my linked answer below - you can do it in WiX, but it is a lot of work and complicated to test. I have not tested the functionality much in Advanced Installer, but I am sure it works well unless you use problematic constructs that hit restrictions and limitations of the underlying technology. I would test different upgrade scenarios. – Stein Åsmul Aug 28 '18 at 12:27
  • thank you for your support! I guess I'll have to dig deeper. :| – Wreigh Aug 29 '18 at 00:52

2 Answers2

1

Paradigmatitis: This requirement does not work well with the MSI paradigm. In order to support side-by-side deployment of different versions both the setup itself and the application must be tweaked to co-exist peacefully so they don't overwrite the same data files and registry keys unexpectedly, don't fight over file associations, etc...

Nice-to-Have?: Is this an absolute requirement or a "nice to have" issue? If I were to implement this I would essentially make each setup version independent of the older ones and maybe use a custom action to trigger the uninstall of the older version, or add temporary rows to the upgrade table. Not trivial. Not rocket science. Not something I have ever tried. So you see the dilemma in making a suggestion.

Side-By-Side: In order to make each setup "side-by-side" capable, I would use WiX's auto-guids and a "moving target" target folder with the version number embedded in the installation folder name. I would also likely set a new upgrade code for each version, although you can make do without that as well. It is generally good to keep the upgrade code the same to identify related products.


Blast from the Past: There are some other possibilities. You could use multi-instance transforms, you could use virtualization. I have written about this before here: Installing Multiple Instances by different msi having same Package Code. Please give it a skim.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
1

In my opinion, the only way you can do this is to have two MSI files. They both will have new ProductCodes, and they are:

  1. Which has the same UpgradeCode and sets the VS RemovePreviousVersions to true to do the replacement upgrade.

  2. Has a different UpgradeCode and is therefore a new product that will install while the previous one is still there.

Then you need a launcher program that asks the user which is required, an upgrade or a side-by-side, and it launches the required one.

The basic problem is that the install might not be "side-by-side" it might be "on top of". What prevents the files in the new one replacing the existing ones in the other installed product? What if the shortcuts have identical names, and how does the user know which to use? Do you need to prevent two versions of the app running at the same time? Are there any "single use" items in the install, such as services (can't have two of the same name) or named events, mutexes and so on? What will be the upgrade strategy when wo versions are installed?

PhilDW
  • 20,260
  • 1
  • 18
  • 28