Home > Software Deployment > Validating Installshield Prerequisites Actually Installed with Install Conditions (LaunchConditions)

Validating Installshield Prerequisites Actually Installed with Install Conditions (LaunchConditions)

EDIT: This post if flawed.  There actually is a built in method Installshield’s boot-strapper uses to validate the prerequisite install was successful.  In a Basic MSI project: Right click on the prerequisite > edit > Behavior tab. Here there’s a drop down: “If, after installing the prerequisite, the conditions still indicate it is required” >  Abort the setup.

However, this setting wouldn’t work if for instance you were installing .NET Framework 3.5 SP1 which could fail to install it’s bundled copy of .NET Framework 2.0 SP2.  (Of which I’ve had reported).  In this case, using the suggestions below to use Launch Conditions that check for 2.0 SP2 would be prudent.

__________________________________________________________________________

We’ve all come to love the ease of adding redistributables to our deployment package through Installshield’s Prerequisite editor.  One thing that’s not so great about it though is that there’s no validation performed to ensure the prerequisite was actually installed.  Our QA department discovered and edge case relating to a failed prerequisite download and I’m going to share the fix I employed to validate that the prerequisite was really installed.

The summary of this post is to point out that prerequisite downloads can fail, but you can validate they were actually installed using MSI Install Conditions.  Additionally, silent installs using the msiexec rather than the Installshield’s setup.exe bootstrapper will also not install prerequisites.  This is another reason to use MSI Install Conditions.

We’re redistributing the .NET Framework 3.5 sp1, but due to media size constraints we can only bundle the web download boot-strapper for the framework.  I talk about this scenario in a previous blog post.  The problem with web downloads is that you’re relying on a stateless Internet connection that could lose network connectivity at anytime causing your download to fail.  (You can replicate this by disconnecting the internet while the download is being performed).  Upon download failure, Installshield’s boot-strapper presents you with the following screen with an option:

At this point the user can choose to cancel or proceed.  In our case, if they chose to proceed our installer would error when trying to register some objects that are dependent on methods only present in the Framework 2.0 sp1 (which would have been updated after the Framework 3.5 sp1 installation on certain OS’s– ya, it’s confusing!)

To catch this ‘edge case’, it’s a good idea to also add an install condition (LaunchCondition table) to your msi. In a Basic MSI project you can find these settings under General Information > Install Condition.

There’s a few different ways to detect the .NET Framework version, but  I’m using the MsiNetAssemblySupport property.

To check for 2.0 sp1, my condition looks like the following:

Condition: MsiNetAssemblySupport >= “2.0.50727.1434”

Message: You must install .NET Framework 2.0 Service Pack 1 or higher before installing this product.

Additionally Wikipedia has a great table showing the Frameworks along with their associated version information.  (3.5 SP1 RTM would be version “3.5.30729.01”)

It’s also worth noting that there are two methods of silent installation for Installshield based deployment packages:

  1. The msi method: msiexec /i yourMSI.msi /qn
  2. The Installshield boot-strapper method: setup.exe /s /v”/qn”

Only the later will install prerequisites, so it’s up to you to author install conditions to ensure the system does indeed have the perquisite present on the machine.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: