Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrapper: Check if msi version is installed before running

I'm trying to find a solution for the following issue:

I have numerous programs (lets call them slaves) that all rely on a single program (master). I need to distribute an installer for each slave. This installer needs to install the master.

I want to be able to version both pieces, so multiple msi's appear to be the right solution, chained with a bootstrapper.

My problem is if a slave installer installs the same version of the master that is already installed, the .msi will run in repair/remove mode.

This is unacceptable from a user standpoint and will just cause confusion.

Is there any way to check for a version of the currently installed fiels before trying to run the msi?

I am currently using WIX's setupbld.exe as a bootstrapper.

Any other solutions greatly appreciated (I have also tried merge modules with no success, since the versioning is useless)

like image 270
gollumullog Avatar asked Nov 14 '22 13:11

gollumullog


1 Answers

Instead of using setupbld.exe (which I don't really know as I can't find any documentation) you can use msbuild's generatebootstrapper task. The wix documentation already covers how to use this task to generate a bootstrapper that installs the .NET framework. See How To: Install the .NET Framework Using a Bootstrapper. This makes use of the pre-defined bootstrapper packages.

However, in this case you will also have to author your own bootstrapper packages. One way to do this is to study the existing bootstrapper packages in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ (or the ones in the Windows SDK) and read the documentation of the Bootstrapper Manifest XML format. The bootstrapper generator tool might also be helpful.

To determine whether the package needs to be installed, you can use one of the InstallChecks to set a property, and then check the property value in a InstallCondition under the Commands element.

If you're thinking that this is all harder than it should be — I agree, but it's what I've used so far. There are some alternatives which I have not tried yet:

  • the poorly named dotNetInstaller which is actually a general purpose bootstrapper generator.
  • the wix 3.5 burn bootstrapper which is not yet released. I'm not sure if it is in a usable state yet.
like image 87
Wim Coenen Avatar answered Dec 21 '22 20:12

Wim Coenen