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
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);