3

Windows Installer 5 added support for the Hyperlink control which I would like to utilize if available. I cannot set a dependency towards Windows Installer 5 (doesn't support WinXP), but I would like my installer to be able to utilize the hyperlink control if Windows Installer 5 is available when running the installer.

How do you manage to do this? Conditional imports of fragment files based on the versionMsi property? A Google code search or regular Google search didn't reveal many samples.

Ryan Kyle
  • 743
  • 8
  • 21
tronda
  • 3,902
  • 4
  • 33
  • 55

2 Answers2

5

You'll want to read this article:

Careful with that Hyperlink (on your MSI dialog)

The summary is you create two nearly idential dialogs and create mutually exclusive control events to drive which one gets displayed based on your MSI version.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Adding a bit to this, you don't want conditional fragment imports (build-time) unless you want to make a panoply of .msi files. Instead you want conditions inside the one .msi you create which key off the VersionMsi property at run-time. In this case, as Chris says, it'd be in the dialog control events to select one of two dialogs. – Michael Urman Feb 16 '11 at 14:21
  • Any pointers on how I would do this with WIX? Could I embed both dialogs within the same WXS file without risking an error during runtime since the dialog wont be used when the versionMsi is lower than 5.0? – tronda Feb 16 '11 at 14:44
  • @tronda, where you put the dialogs in your WXS files does not matter much. The important piece is that you have a condition on your `Publish` tags which prevent the dialog with the hyperlink appearing unless the `VersionMsi` property is high enough. – heavyd Feb 16 '11 at 16:36
  • Sorry, I only use WiX UI when I need Minimal with no customizations. When I need heavy UI lifting I use InstallShield. – Christopher Painter Feb 16 '11 at 20:09
  • tronda did uncover a caveat to this solution [in this question](http://stackoverflow.com/questions/6411462/conditional-choose-between-two-exit-dialog-when-using-wixs-installdir-ui-extens) as the Exit dialog is a special case. – Rob Hunter Oct 16 '12 at 11:33
  • You could use Dynamic UI to inject the hyperlink control only when it's supported. http://blog.deploymentengineering.com/2008/07/dynamic-windows-installer-ui.html – Christopher Painter Oct 16 '12 at 14:20
0

I am using WIX Installer and used this code. Wix is a free open source tool and is same like the costly other tools. I used this code for hyperlink and it works perfect

        <Control Id="MyHyperlinkControl1" Height="20" Width="100" Type="Hyperlink" X="5" Y="105">
          <Text><![CDATA[<a href="http://www.stackoverflow.com/">Stackoverflow</a>]]></Text>
        </Control>
Sunil Agarwal
  • 4,097
  • 5
  • 44
  • 80
  • 1
    I cannot see how you address the main issue which is how to handle installers when the MSI version doesn't support Hyperlinks. – tronda May 30 '11 at 19:39