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 |
|Dialog with hyperlink control on Windows Vista |
Error code 2885 means "Failed to create the control  on the dialog ."
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:
- Create a static text control
- Set its text in HTML format: like this:
where the href parameter specifies the URL and the text between the opening and the closing tag is what gets displayed.
- Go to Direct Editor and select the table named Control.
- 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