繁体   English   中英

Inno Setup,仅安装在不存在的目录上

[英]Inno Setup, install only on a non existent directory

我不想允许在现有目录或至少非空目录上安装。

现在我正在使用此解决方法只是为了检查程序是否安装在用户选择的目录中,但如果它是未安装程序的目录或非空目录,则这不起作用。

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}'))检查所选目录是否存在。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM