Can't delete the folder created in My Documents with Inno Setup

老子叫甜甜 提交于 2019-12-01 10:49:54

You are trying to delete a folder named 'ExpandConstant({userdocs}\SpellForce2)' (literally), just remove the ' character to the ExpandConstant call (it is a call to a sub-routine).

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
  mres : integer;
begin
  case CurUninstallStep of
    usPostUninstall:
      begin
        mres := MsgBox('Do you want to delete saved games?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
        if mres = IDYES then
          DelTree(ExpandConstant('{userdocs}\SpellForce2'), True, True, True);
      end;  
  end;
end;

You cannot do

DelTree('ExpandConstant({userdocs}\SpellForce2)', True, True, True);

Of course, this should read

DelTree(ExpandConstant('{userdocs}\SpellForce2'), True, True, True);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!