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

后端 未结 2 745
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 02:47

I have tried to use the program described here Problems in deleting a Folder during the uninstalation with Inno Setup

after the answers were posted but for some unkn

2条回答
  •  佛祖请我去吃肉
    2021-01-15 02:57

    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;
    

提交回复
热议问题