Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing multiple instances of an Application with Wix Toolset

I simply need to install multiple instances of my application saving them in different folders, with no shortcut on desktop. In other words, when the App is already installed in a Folder, if I double-click the .msi file once again, the installer shouldn’t ask me if I want repair or remove my App, but it simply should permit to install it in a new folder. How can I solve this problem?

like image 318
Costanzo Ferraro Avatar asked Mar 14 '23 06:03

Costanzo Ferraro


1 Answers

I used to work with this kind of installations before, and I would agree with @Nikolay - it is rather an exception, than the rule when it comes to Windows Installer based installations. Component rules are often tricky to follow, and multiple instances aspect adds some complexity on top. So, think twice before you go this road.

Being complex, it is still possible. Years ago I published the article of how to start authoring multiple instance installations with WiX 3.6. Note that this version of WiX simplifies it significantly. It's not a short read, so here is a quick digest:

  • You won't be able to achieve the "install each new instance with double-clicking MSI file" behavior. You have to have a bootstrapper - something that passes correct command line parameters to msiexec.exe.
  • Don't try to support unlimited number of instances - try sticking with reasonably big number. Do you imagine someone installing your app 10 times on a machine? 50? 100? Make a sane choice - this will be the number of your <Instance/> elements.
  • Although you only have to decorate non-file data components with MultiInstance attribute, I don't think it will break if you add it to all of your components.
  • Although I explained the patching of multiple instances in that post, I would only use it in production if I had no other choice.
like image 90
Yan Sklyarenko Avatar answered Apr 27 '23 13:04

Yan Sklyarenko