Hyperlink Control

InstallShield 2024

Project: This information applies to the following project types:

Basic MSI
Merge Module

To learn how to add an HTML control to a dialog in an InstallScript project or in an InstallScript MSI project, see Using an HTML Control on a Dialog.

Use the hyperlink control to add a hyperlink to a dialog in your project. The hyperlink control displays an HTML link; clicking the link at run time opens a page in the default browser on the target system.

Important:Windows Installer 5 and later include support for the hyperlink control. If this control is used on a dialog that is displayed on a system that has an earlier version of Windows Installer, run-time error 2885 occurs, and the installation aborts. Therefore, if you want to use the hyperlink control on a dialog but your installation targets systems that have Windows Installer 4.5 or earlier, it is recommended that you include two versions of the dialog in your project: one with the hyperlink control, and one without it. Add conditions to the dialogs to show or hide them, depending on the version of Windows Installer that is present.

Following is a sample condition that you could use for the dialog that contains the hyperlink control:

VersionMsi >= "5.00"

Following is a sample condition that you could use for the alternate dialog that does not contain any hyperlink control:

VersionMsi < "5.00"

When you select a hyperlink control in a dialog of the Dialogs view, InstallShield displays the following settings in the right pane.

Settings for a Hyperlink Control

Setting

Description

Name

Enter a name for this hyperlink control. The name must be unique among all of the controls in your project.

Base Text Style

This font style is used for the control’s label if you specify nothing for the Text Style setting.

Cancel

If this is the only control on the dialog that will dismiss the dialog, select True. Clicking the cancel control has the same effect as pressing the ESC key or clicking the Close button on the title bar. The Cancel or Finish button is usually the cancel control.

This value is ignored if True is selected for the ErrorDialog setting of the dialog that contains this control.

Code Page

If you want the control to use fonts from the code page that is defined in the installation’s package, select Database. If you want the control to use fonts from the target system’s default code page, select User’s System.

Context Help

This setting is reserved for future use. Windows Installer does not currently support launching context-sensitive help topics from the installation.

Default

If this is the only control on the dialog that you want to be the default control, which means that it is activated when the end user presses the ENTER key, select True. The Next or OK button is usually the default control.

Enabled

Indicate whether the control is enabled. True means that this control is available (the end user can interact with it). False means that it is not available (grayed out).

Format as Bytes

If you want the installation to attempt to display the value that is entered in the Text setting in bytes, select True. If you select True, the Text setting must contain only a number, without the unit. Then, at run time, it is divided by 512 and displayed as the correct number of kilobytes, megabytes, or gigabytes, depending on the size.

Height

Specify the height of the control in Windows Installer user interface units (1/12 of the height of the system font).

Left

Specify the distance from the left edge of the dialog to the start of the control in installer units (1/12 of the height of the system font).

No Prefix

If the Text setting contains an ampersand that should be displayed as an ampersand character (&), select True.

If you are using the ampersand in the Text setting to indicate that the letter that follows the ampersand should be underlined (for example, &Click would be displayed as Click), select False.

No Text Wrap

Indicate whether you want to allow the text to wrap in this control. If you select True and the text expands beyond the width of the text area, the end of the string is cut off and replaced with an ellipsis button (...). Otherwise, the text wraps and can extend beyond the height of the text area, if it is not long enough.

Property

Enter the name of a property that is set when an end user clicks this hyperlink. This property can be unique to this control; it does not need to be present in the Property Manager view.

Right-Aligned

The default value of False aligns the text to the left of the control. Set it to True to align the text to the right.

Right-to-Left

For English and other languages that are written from left to right, select False. For Hebrew and those languages that are read from right to left, select True.

Sunken

To give the control’s edges a recessed, three-dimensional appearance, select True. To use the default visual style for the control, select False.

Tab Index

Assign an integer that—along with the other controls on this dialog but excluding controls such as static text—specifies the order in which each control on the dialog receives focus when the end user presses the TAB key. The lowest tab index that you can use is the number 0.

Tab Stop

Indicate whether this control receives focus within the tab order. True indicates that the control receives focus; False indicates that the control does not receive focus.

Text

This setting contains the text that is used for the control. Use HTML markup in this setting for your hyperlink. Following is a sample entry for this setting:

To learn about the latest offerings from ABC Company, visit the <a href="http://www.abccompany.com">ABC Company Web site</a>.

For this sample, the ABC Company Web site text is displayed as a hyperlink that points to the http://www.abccompany.com Web site.

Note that the only protocol that is supported for the hyperlink is HTML.

When you type a value for this setting, you are creating a string entry and setting its initial value for all of the languages that are currently in the project. As an alternative to typing a new value, you can click the ellipsis button (...) in this setting to select an existing string. For more information, see Using String Entries in InstallShield.

Text Style

Select the font style, size, and color (if available) in which you want the control’s label to be displayed. Leaving the value as <Default> displays the font that is contained in the DefaultUIFont property.

Tooltip

Enter the text that you want to be displayed when the end user places the mouse pointer over the control.

When you type a value for this setting, you are creating a string entry and setting its initial value for all of the languages that are currently in the project. As an alternative to typing a new value, you can click the ellipsis button (...) in this setting to select an existing string. For more information, see Using String Entries in InstallShield.

Top

Specify the distance from the top of the dialog to the top of the control in installer units (1/12 of the height of the system font).

Transparent

If you want the background to show through this control, select True.

Note that you may want to avoid making this control transparent if you are placing it on top of a colored bitmap. The text may not be visible if end users change the color scheme of their display. For example, the text in this control may become invisible if an end user sets the high-contrast parameter for accessibility reasons.

Visible

True means that the control is visible, and False means that it is hidden. You can also make the control visible by editing its condition in the Behavior area for the dialog.

Width

Specify the width of the control in Windows Installer user interface units (1/12 of the height of the system font).

See Also