Removedir 函数不起作用

Removedir function is not working

我是inno setup的新手,所以请原谅任何无知。 我试图仅在文件夹为空时才删除它 这是脚本:

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usPostUninstall then
  begin
    RemoveDir(ExpandConstant('{userdocs}\Games'), True, True, True);
  end;
end;

这重新运行一个错误:

Invalid number of parameter.

我从这个网站得到了(不是完整的代码,而是一些片段)。 我还有一个问题,RemoveDir函数是否检查文件夹是否为空? 我已经阅读了文档。 请help.Thanks.

根据 docs 函数只获取一个参数:

Prototype:

function RemoveDir(const Dir: string): Boolean;

Description: Deletes an existing empty directory. The return value is True if a new directory was successfully deleted, or False if an error occurred.

啊终于自己解决了,发现那个错误reason.OH很头疼,卡死了。 我只需要删除 true;

完整代码如下:

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usPostUninstall then
  begin
    RemoveDir(ExpandConstant('{userdocs}\Games'))
  end;
end;

现在它完全正常工作了。

感谢大家的帮助。