Chinaunix首页 | 论坛 | 博客
  • 博客访问: 571864
  • 博文数量: 208
  • 博客积分: 3286
  • 博客等级: 中校
  • 技术积分: 1780
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-24 20:38
文章分类

全部博文(208)

文章存档

2012年(7)

2011年(28)

2010年(21)

2009年(76)

2008年(65)

2007年(11)

我的朋友

分类:

2009-03-27 18:32:42

 
PreviousNext
Help Library

AskYesNo

InstallShield 2009 » InstallScript Language Reference

The AskYesNo function presents a message box that displays a question the end user can answer by clicking a Yes or No button. The AskYesNo message contains four items:

  • Question mark icon
  • Question text
  • Yes button
  • No button
Note

Note

The default title is Question. To change the contents of the title bar, call before calling AskYesNo.

The AskYesNo message box is created by a direct call to the corresponding Windows API function, which displays a system modal dialog. Once a modal dialog is displayed, it retains focus until it is closed by the end user.

Because this dialog is displayed by Windows, the text in the buttons cannot be changed by the installation. That text—"Yes" and "No" in the English version—is displayed by Windows in the language appropriate to the version of Windows on which the installation is being run; no manual localization of this text is required. If you need to display a more flexible dialog, call a Windows API function directly or use a custom dialog.

Syntax

AskYesNo ( szQuestion, nDefault );

Parameters

AskYesNo Parameters 

Parameter

Description

szQuestion

Specifies the question to display in the message box. If the message is too large to fit on one line, embed newline escape characters ( \n ) in the message to insert line breaks.

nDefault

Specifies the button that is selected by default. Pass one of the following predefined constants in this parameter:

  • YES—The Yes button is highlighted when the dialog opens.
  • NO—The No button is highlighted when the dialog opens.

Return Values

AskYesNo Return Values 

Return Value

Description

YES (1)

Indicates that the user clicked the Yes button.

NO (0)

Indicates that the user clicked the No button.

Additional Information

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

See Also


InstallShield Help Library
5 June 2008

 

 

 

 

 

 

 

 

 

PreviousNext
Help Library


AskYesNo Example

InstallShield 2009 » InstallScript Language Reference

Note

Note

To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

/*-----------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the AskYesNo function.

*

* This script asks the user whether or not to display the

* ReadMe file.  If yes, the script launches the Windows

* Notepad to open a ReadMe file.

*

* Note: Before running this script, set the preprocessor

*       constants so that they reference the fully qualified

*       names of the Windows Notepad executable and a valid

*       text file on the target system.

*

\*-----------------------------------------------------------*/

#define PROGRAM "C:\\Windows\\Notepad.exe"

#define PARAM   "C:\\Windows\\Readme.txt"

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

export prototype ExFn_AskYesNo(HWND);

function ExFn_AskYesNo(hMSI)

begin

    // Display the AskYesNo dialog.  The default is set to Yes.

    if (AskYesNo("Installation complete. Would you like to read the Readme " +

                "file now?", YES) = YES) then

        LaunchApp(PROGRAM, PARAM);

    endif;

end;


InstallShield Help Library
5 June 2008
 | 

 | 
阅读(845) | 评论(0) | 转发(0) |
0

上一篇:AskText

下一篇:BatchAdd

给主人留下些什么吧!~~