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

后端 未结 2 722
没有蜡笔的小新
没有蜡笔的小新 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;
    
    0 讨论(0)
  • 2021-01-15 02:57

    You cannot do

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

    Of course, this should read

    DelTree(ExpandConstant('{userdocs}\SpellForce2'), True, True, True);
    
    0 讨论(0)
提交回复
热议问题