gpt4 book ai didi

inno-setup - Inno Setup 检查文件是否存在于选定的目标位置

转载 作者:行者123 更新时间:2023-12-04 17:51:45 29 4
gpt4 key购买 nike

我已经为我想更新的程序创建了文件。
我希望在安装之前,检查程序是否也在标准目录中,如果不是,则正确的目录可以选择程序所在的位置。

我试过这个:

[Files]
Source: "C:\Data"; DestDir: "{app}"; Flags: ignoreversion

[Code]
function NextButtonClick(PageId: Integer): Boolean;
begin
Result := True;
if (PageId = wpSelectDir) and not FileExists(ExpandConstant('C:\Program\Test\Test.exe')) then begin
MsgBox('YourApp does not seem to be installed in that folder. Please select the correct folder.', mbError, MB_OK);
Result := False;
exit;
end;
end;

但在安装过程中它不会检查它。
无论该程序是否可用,它都会安装它。

我希望有人能帮助我。

最佳答案

您必须在测试中使用 {app} 常量来检查所选文件夹:

FileExists(ExpandConstant('{app}\Test.exe')) 

关于inno-setup - Inno Setup 检查文件是否存在于选定的目标位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44169708/

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