我想不允许在现有目录或至少非空目录上安装。
现在我正在使用这种解决方法来检查程序是否安装在用户选择的目录中,但如果它是未安装程序的目录或非空程序,则不起作用。
function NextButtonClick(PageId: Integer): Boolean;
begin
Result := True;
if (PageId = wpSelectDir) and FileExists(ExpandConstant('{app}\some_app_file')) then
begin
MsgBox('Warning message, cannot continue.', mbError, MB_OK);
Result := False;
exit;
end;
end;
我有DirExistsWarning=yes
指令,但这还不够。
谢谢您的帮助。
使用DirExists(ExpandConstant('{app}'))
检查是否存在所选目录。