MessageBox

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

Basic MSI
InstallScript
InstallScript MSI

The MessageBox function presents a dialog that contains a message, an icon that indicates the nature of the message (information, warning, or severe), and an OK button. The default title depends on the value of nType, which also indicates the icon type. For example, if you pass INFORMATION in nType, the title Information appears in the title bar. The titles are blank by default, unless you set them by calling SetDialogTitle before calling MessageBox. If the titles are blank, the title bar text for message box is the product name (from IFX_SETUP_TITLE).

This function uses the Microsoft Windows API MessageBox. The operating environment, not the installation, determines the size and location of the message box. The operating environment also generates the text for the OK button in the local language (the language that the operating system is running under). You cannot change the text on this button. For more information regarding the use of Windows MessageBox types, consult the description of the MessageBox Windows API function in the appropriate Windows SDK.

Note the following when using Windows message box constants:

Some Windows MessageBox type constants are predefined in the ISRTWindows.h file that is provided in the InstallShield Program Files Folder\Script\Isrt\Include folder. This file is automatically included in your installation when you include Ifx.h in your script. You do not need to redefine any constants that are defined in ISRTWindows.h; doing so will result in a compiler warning. To determine which constants are predefined, refer to the ISRTWindows.h file.
To use constants that are not defined in ISRTWindows.h, you must define them (using #define) in the declaration block of your installation script. You cannot simply include the Windows.h file that is usually part of a C++ program. The values that you need to assign to the undefined constants can generally be found in an include file that is provided with the appropriate Windows SDK or development tool. (For Microsoft Visual C++, most constants can be found in the Winuser.h file, which is located in the InstallShield Program Files Folder\Script\Resource folder.)
Windows and InstallShield message box constants cannot be used together in an installation. If an InstallShield message box constant is combined with a Windows message box constant using the OR operator (|), the Windows message box constant is ignored.
Some Windows message box styles are not supported on some Windows platforms. To determine whether a particular style is supported on the operating systems that are targeted by the installation, consult the appropriate Windows SDK.
When a Windows message box style is used by the MessageBox function, the caption (title) of the message box is Install. If you need to display a different caption, use the MessageBoxEx function.

Syntax

MessageBox ( szMsg, nType );

Parameters

MessageBox Parameters

Parameter

Description

szMsg

Specifies the message to display. InstallShield does not automatically break the text of the message into separate lines to fit in the message box. If the message is too long for one line, insert a line break by embedding newline escape characters ( \n ) at appropriate places in the string.

nType

Specifies the type of message box to create and the type of icon to display in the message box. Pass one of the following predefined constants in this parameter:

INFORMATION
WARNING
SEVERE

Any Windows API MessageBox type can also be specified in this parameter. Multiple styles can be combined logically using the OR operator to produce the required MessageBox type.

Return Values

The return value is not significant unless you are using standard Microsoft Windows message box styles. If you are using these styles, the return value is the same as the return value from the MessageBox API functions.

Additional Information

The dialog that is displayed by the MessageBox function cannot be displayed with a skin; it appears the same regardless of whether you have specified a skin.

See Also