Text attributes (MSI)

Reference information
Project page Dialogs and Billboards
Related topics Working with attribute panes
External links External link Windows Installer documentation

Introduction

A Text control displays a text string, usually as a label for another control or as explanatory text in a dialog box.

Tip: To use a Text control as a label for another control, the Text control should precede the other control in the dialog's tab order. You can achieve this in the Dialogs tree on the Dialogs and Billboards project page by moving the Text control to immediately above the other control.

Tarma note The Tarma Installer equivalent is the StaticText control.

Dynamic text display

You can also use a Text control to display a dynamic text string by mapping the control to an event generated elsewhere in the same dialog. Some common examples are listed below. For a complete list, refer to the ControlEvent documentation in the External link Windows Installer documentation on the MSDN web site.

Current installation action
  1. Place the Text control on the progress dialog box of the installer (by default, this is the ProgressDlg dialog box).
  2. Create an event mapping for the ActionText event and set the event mapping's Attribute field to Text.
  3. Leave the Text control's Caption empty; it will be filled with an action description from the Action Texts project page or the custom action description.
Estimated remaining time for the installation
  1. Place the Text control on the progress dialog box of the installer (by default, this is the ProgressDlg dialog box).
  2. Create an event mapping for the TimeRemaining event and set the event mapping's Attribute field to TimeRemaining.
  3. Leave the Text control's Caption empty; it will be filled with the text from the TimeRemaining text string on the Localized Strings project page.

The remaining time will be displayed if the installation takes more than a few seconds.

Description of the selected feature
  1. Place the Text control on the same dialog box that contains the SelectionTree control for feature selection (by default, this is the CustomizeDlg dialog box).
  2. Create an event mapping for the SelectionDescription event and set the event mapping's Attribute field to Text.
  3. Leave the Text control's Caption empty; it will be filled with the description of the currently selected feature as defined on the Components and Features project page.
Size of the selected feature
  1. Place the Text control on the same dialog box that contains the SelectionTree control for feature selection (by default, this is the CustomizeDlg dialog box).
  2. Create an event mapping for the SelectionSize event and set the event mapping's Attribute field to Text.
  3. Leave the Text control's Caption empty; it will be filled with the text from the one of the SelXxxCost text strings on the Localized Strings project page.
Installation path of the selected feature
  1. Place the Text control on the same dialog box that contains the SelectionTree control for feature selection (by default, this is the CustomizeDlg dialog box).
  2. Create an event mapping for the SelectionPath event and set the event mapping's Attribute field to Text.
  3. Leave the Text control's Caption empty; it will be filled with the installation path of the currently selected feature.

Attributes

This pane contains the following attributes and options.

Attribute Description
Control name Enter the name of the control. This name has no special significance, but it must be unique among all controls of its parent dialog or billboard.
Caption

Enter the text to display as the control's text. If you want a letter to appear underlined and act as a keyboard accelerator (as in the Windows' Label: style), you should prefix the letter with an ampersand ('&'). For example, &Label will appear as Label in the dialog box.

Note: The visibility of the underline is subject to the Windows settings on the target system (and your own development system); on Windows 2000 and later, the underline only appears if you first press the Alt key.

Help text Enter text for display in help tooltips.
Font

Select the font style for the text in the control by clicking ... (browse) to open the Select Font Style dialog.

Visible

Check this box to make the control initially visible; clear it to hide the control. You can change the visibility status of the control at installation time by using Control conditions.

Enabled

Check this box to enable the control initially; clear it to disable the control. An enabled Text control appears black; a disabled Text control appears grayed out. You can change the enabled status of the control at installation time by using Control conditions.

Bug note Although the corresponding attribute is set in the installation database, Windows Installer ignores it. This seems to be a bug in Windows Installer.

Sunken Check this box to make the control appear sunken; clear it to display it flush with its parent dialog or billboard. A sunken control has a simulated 3D border.
Right align Check this box to display the caption text right-aligned in the control's area; clear the box to make it left-aligned.
Don't mirror Check this box to keep the control's orientation as it is and not mirror it for languages that use a right-to-left (RTL) order; clear it to mirror the control if the parent dialog is mirrored for RTL languages. This option only has effect for languages that use an RTL reading order, such as Arabic and Hebrew; for other languages it is ignored.
No prefix

Check this box if the Caption field may contain ampersands ('&'), but you don't want them to be interpreted as prefixes for underlining. Clear this box if ampersands should be interpreted as prefixes for keyboard accelerators and cause the following letter to be underlined.

No wrap Check this box to disable word-wrapping in the Text control; clear it to allow text that exceeds the control's width to wrap to the next line. In that case, you should ensure that the control's area is high enough to accommodate the additional lines.
Transparent

Check this box to make the control have a transparent background; clear it to display it with an opaque background. This is useful if the Text control appears on top of another control that serves as the background, for example a Bitmap control.

Format size

Check this box to format the text as a number of bytes with automatic scaling to KB, MB, and GB; clear it to display the text as-is. This only works if the Text control contains a number. For the scaling suffix, Windows Installer uses the text strings KB, MB, and GB on the Localized Strings project page.

User's language Check this box to indicate that the text is encoded in the user's default ANSI code page; clear it to have them use the installer database's code page. Unless you have a very specific reason to change this, you should leave this box cleared.