Careful with that Hyperlink (on your MSI dialog)

One of the new features in version 5 of the Windows Installer runtime is support for hyperlink controls on setup dialogs. Remember that MSI 5 is only available on Windows 7 and Windows Server 2008 R2, but there's no redistributable for down-level platforms.

In most cases when introducing new features, the MSI team made sure they don't break your setup on older runtime versions. For instance, older MSI versions simply ignore new tables that they can't use. This enables developers to create a setup that will run with basic functionality on older platforms but on the latest MSI version the new features would "light up".

The hyperlink control is different, maybe because it's not a table but a new control type in an existing table, the Control table. Thus, it causes your setup to fail on Windows Installer versions prior to MSI 5:

Dialog with hyperlink control on Windows 7
HyperlinkW7
Dialog with hyperlink control on Windows Vista
HyperlinkVista

Error code 2885 means "Failed to create the control [3] on the dialog [2]."

Workaround

To work around this issue, create two versions of the dialog, one with the hyperlink control, and the other without. Use these condition to display the appropriate dialog:

  • VersionMsi >= "5.00" (for the dialog with hyperlink control)
  • VersionMsi < "5.00" (for the dialog without hyperlink control)

Note that making the hyperlink control invisible for MSI versions < 5 doesn't help. You really need a separate dialog.

How to create a hyperlink control (if your tool doesn't support it)

I've used Advanced Installer to create the above screen shots, because its dialog editor can create hyperlink controls. If you are using InstallShield or another tool that doesn't support hyperlink controls (yet) but has a way to modify the msi tables directly, you can create a hyperlink control using these easy steps:

  1. Create a static text control
  2. Set its text in HTML format: like this:
    <a href=http://www.installsite.org>www.InstallSite.org</a>
    where the href parameter specifies the URL and the text between the opening and the closing tag is what gets displayed.
  3. Go to Direct Editor and select the table named Control.
  4. Find your text control and change the Type from Text to Hyperlink.

This manual procedure even gives you more flexibility. For instance you could hyperlink only part of the text, while in Advanced Installer the complete text is hyperlinked. The following screen shot was created with InstallShield using this string for the Hyperlink Text:

Please visit <a href="http://www.installsite.org">InstallSite.org</a> for more samples

HyperlinkIS

Published Fri, Sep 18 2009 21:51 by stefan

Comments

# re: Careful with that Hyperlink (on your MSI dialog)

What a mess.  MSI should have had a hyperlink control since v1.0.  The internet only became a big thing some 5 years before MSI was shipped.

Microsoft is shipping too few features far too late to be useful.  Just go to an external UI and move on IMO.

Friday, September 18, 2009 5:39 PM by Christopher Painter

# re: Careful with that Hyperlink (on your MSI dialog)

On the off chance that Microsoft ever actually downlevels this capability it would be nice if we could get them to announce a possible future property to establish a contract.  Something like

VersionMsi >= "5.00" Or MsiHyperLinkSupport

Friday, September 18, 2009 6:52 PM by Christopher Painter

# re: Careful with that Hyperlink (on your MSI dialog)

There is a second workaround in Advanced Installer: using Enhanced UI, an external UI implementation we provide to solve this exact kind of issues and to provide additional and updated controls to MSI installers.

We'll probably add a prompt for user to automatically turn on EUI when attempting to use hyperlinks. Stephan's duplicate dialog solution may be too cumbersome.

A WI5.0 launch condition would restrict the package for Windows 7 or higher. While at this point I doubt many developers want that, it could be a better solution in the future if W7 gains traction or WI5 gets redistributables for older platforms.

Monday, September 21, 2009 8:33 AM by Catalin Rotaru