Inno setup官方文档:/ishelp/
进入官网切换到index,往下划就可以找到MsgBox,以及其他一些你想要的信息。下面摘抄了MsgBox的使用方法。
Prototype:
function MsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons: Integer): Integer;
Description:
Displays a message box.Textspecifies the message to display.Typspecifies which icon to display in the message box.Buttonsspecifies which buttons to include in the message box. Returns an ID* constant indicating the button the user clicked, or 0 if the function fails (which shouldn't happen unless an invalid parameter is specified or system resources are exhausted).
Remarks:
TMsgBoxType is defined as:
TMsgBoxType = (mbInformation, mbConfirmation, mbError, mbCriticalError);
Supported flags forButtonsare:
MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_SETFOREGROUND
Possible return values are:
IDOK, IDCANCEL, IDABORT, IDRETRY, IDIGNORE, IDYES, IDNO
Example:
begin// Display a simple message box with an OK buttonMsgBox('Hello.', mbInformation, MB_OK);// Ask the user a Yes/No questionif MsgBox('Are you sure?', mbConfirmation, MB_YESNO) = IDYES thenbegin// user clicked Yesend;// Ask the user a Yes/No question, defaulting to Noif MsgBox('Are you sure?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES thenbegin// user clicked Yesend;end;
See also:
SuppressibleMsgBox
TaskDialogMsgBox
其中MsgBox('Are you sure?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)表示有两按钮,一个是,默认选择否
MsgBox('Are you sure?', mbConfirmation, MB_YESNO)表示有两按钮,一个是,默认选择是
MsgBox('Hello.', mbInformation, MB_OK)表示只有一个按钮
支持的按钮类型有
MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_SETFOREGROUND
{srcexe} 安装程序包的执行文件路径,即exe所在路径.
{src} 安装程序所在路径.
[Code]
var
ResultStrPath : String;
ResultStrPath := ExpandConstant('{srcexe}');
MsgBox(ResultStrPath , mbInformation, MB_OK);//弹窗显示安装程序包路径
Msgbox中换行为:#13#10//13 为回车字符
Msgbox('注意。' #13#10 '你是白痴!', mbConfirmation, MB_YESNO)
其他更多《Inno setup 常用修改技巧》见其他人的博客:/wzh200x/article/details/7190534