gpt4 book ai didi

inno-setup - Inno Setup,在文件夹选择步骤中显示消息框

转载 作者:行者123 更新时间:2023-12-02 09:23:15 29 4
gpt4 key购买 nike

我尝试仅在用户到达文件夹选择页面时显示消息框,以下是在设置开始时显示消息框的实际代码:

[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) 那么...[运行上面的代码]

但我真的不知道怎么办,谢谢你的帮助。

最佳答案

最理想的事件是 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;

关于inno-setup - Inno Setup,在文件夹选择步骤中显示消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15007750/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com