Inno setup 页面上的Inno设置提示已更改?
我有一个自定义选项页面,有几个选项。在Inno setup 页面上的Inno设置提示已更改?,inno-setup,prompt,Inno Setup,Prompt,我有一个自定义选项页面,有几个选项。在CurPageChanged事件中,我想知道选择了哪个选项,如果选择了某个特定选项,则提示用户是否确定要使用该选项。此页是欢迎页之后的第一页 procedure CreateInstallTypePage; begin InstallTypePage:= CreateInputOptionPage(1, 'Installation Type', 'Specify whether this is a client installation or serve
CurPageChanged
事件中,我想知道选择了哪个选项,如果选择了某个特定选项,则提示用户是否确定要使用该选项。此页是欢迎页之后的第一页
procedure CreateInstallTypePage;
begin
InstallTypePage:= CreateInputOptionPage(1, 'Installation Type', 'Specify whether this is a client installation or server installation, or both.', 'Choose an installation type:', True, False);
InstallTypePage.Add('This is a client computer');
InstallTypePage.Add('This is the main server computer');
InstallTypePage.Add('This is the only computer (stand-alone)');
InstallTypePage.Values[0]:= True;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
Log('CurPageChanged(' + IntToStr(CurPageID) + ') called');
case CurPageID of
1: begin
if InstallTypePage.Values[1] then begin
if MsgBox('Server installation will create a new database on this machine. Continue?',
mbInformation, MB_YESNO) = idYes then
begin
//Continue to next page
end else begin
//Don't continue to next page
end;
end;
end;
end;
end;
这不起作用,当用户从该页面按Next时,它不会提示。相反,当用户返回页面时,它会起作用。显然那不是我需要的。我怎样才能让这个提示生效呢?再稍微修改一下,就明白了。我不得不转到
NextButtonClick
而不是CurPageChanged
,因为CurPageChanged
发生在事件发生之后
function NextButtonClick(CurPageID: Integer): Boolean;
var
ResultCode: Integer;
begin
Log('NextButtonClick(' + IntToStr(CurPageID) + ') called');
Result := True;
case CurPageID of
InstallTypePage.ID: begin
if InstallTypePage.Values[INSTALL_SERVER] then begin
Result:= MsgBox('Server installation will create a new database on this machine. Continue?', mbInformation, MB_YESNO) = idYes;
end;
end;
end;
end;
实际上我刚意识到CurPageChanged是个错误的地方,NextButtonClick应该是这个地方。。。