ShowMessage Method

Top  Previous  Next

Displays a message dialog.

[VBScript]

res = Installer.ShowMessage(Text, Title, Flags)

 

[JScript]

res = Installer.ShowMessage(Text, Title, Flags);

Parameters

Text

The message text.

Title

The message window title.

Flags

Numeric expression that is the sum of values specifying the number and type of buttons to display and the icon style to use. See Remarks section for values. Use numeric constants or their symbolic equivalents in VBScript.

Remarks

This method displays the message dialog, waits for the user to click a button, and returns a value indicating which button was clicked.

The return value is numeric and may be one of the following values:

Constant

Name available in VBScript

Button pressed

1

vbOK

OK

2

vbCancel

Cancel

3

vbAbort

Abort

4

vbRetry

Retry

5

vbIgnore

Ignore

6

vbYes

Yes

7

vbNo

No

The Flags parameter should contain the combination of the following values:

Constant

Name available in VBScript

Description

0

vbOKOnly

Display OK button only.

1

vbOKCancel

Display OK and Cancel buttons.

2

vbAbortRetryIgnore

Display Abort, Retry, and Ignore buttons.

3

vbYesNoCancel

Display Yes, No, and Cancel buttons.

4

vbYesNo

Display Yes and No buttons.

5

vbRetryCancel

Display Retry and Cancel buttons.

16

vbCritical

Display Critical Message icon.

32

vbQuestion

Display Warning Query icon.

48

vbExclamation

Display Warning Message icon.

64

vbInformation

Display Information Message icon.

Refer to the documentation of a MessageBox function for more details.

Installer variables are supported in the following parameters: Text and Title. To emit the value of installer variable MyVar, use the following form: ${MyVar}.

Uninstall support

This action does not support uninstallation.

Example (VBScript)

res = Installer.ShowMessage("Do you wish to visit the ${ProductName} web site?", _

  "Finishing installation", vbYesNo+vbExclamation)

If res = vbYes Then

  Installer.RunProgram "http://www.awinstall.com/moreinfo.html"""False

End If

Example (JScript)

res = Installer.ShowMessage("Do you wish to visit the ${ProductName} web site?",

  "Finishing installation", 4 + 48);

if (res == 6)

  Installer.RunProgram("http://www.awinstall.com/moreinfo.html"""false);