我只是在用户到达文件夹选择页面时尝试显示一个消息框,这里是在设置开始时显示消息框的实际代码:
[code]
var ApplicationPath: string;
function GetAppPath(Param: String): String;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\XXX\XXX', 'Install Dir', ApplicationPath)
if ApplicationPath = '' then
begin
MsgBox('Install folder non found', mbError, MB_OK);
result:=ApplicationPath;
end
else
MsgBox('Install folder found in "' + ApplicationPath + '". NOTE: close the program before proceeding.', mbInformation, MB_OK);
result:=ApplicationPath;
end;
end.
我需要类似的东西:
如果(PageId = wpSelectDir)那么...... [运行以上代码]
但实际上我不知道如何,谢谢你的帮助。
答案 0 :(得分:2)
理想的事件是CurPageChanged
。当显示选择目录页面时,您可以使用这种方式运行代码:
[Code]
procedure CurPageChanged(CurPageID: Integer);
var
AppPath: string;
begin
if (CurPageID = wpSelectDir) then
begin
// this will query the string value in registry; if that succeed and the
// value is read, then the message box about success is shown, otherwise
// the error message box about failure is shown
if RegQueryStringValue(HKLM, 'SOFTWARE\XXX\XXX', 'Install Dir', AppPath) then
MsgBox('Installation folder found...', mbInformation, MB_OK)
else
MsgBox('Installation folder not found...', mbError, MB_OK);
end;
end;