Bootstrapper: Check if msi version is installed before running
Asked Answered
G

1

5

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)

Gyroscope answered 10/12, 2009 at 23:12 Comment(0)
E
1

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.
Electroencephalograph answered 11/12, 2009 at 21:7 Comment(1)
I ended up using dotNetInstaller, and have found that while not perfect, it is better than using the Microsoft boostrappers (couldn't get them to work how I needed). So far every thing I've tried to do with dotNetInstaller has worked. Although sometimes it needs a little guidance.Gyroscope

© 2022 - 2024 — McMap. All rights reserved.