I begin by saying that i am new in using Inno setup and i am sorry if this is a dumb question. I am trying to delete a folder with all it's sub-folders and files during the uninstallation of an application. The specific folder is created in My Documents when the application runes for the first time. For deleting it i am using the "Delltree" function:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var Ceva: integer;
begin
case CurUninstallStep of
usUninstall:
begin
MsgBox('CurUninstallStepChanged:' #13#13 'Uninstall is about to start.', mbInformation, MB_OK)
end;
usPostUninstall:
begin
Ceva := MsgBox('CurUninstallStepChanged:' #13#13 'Do you want to delete the folder ?.', mbConfirmation, MB_YESNO)
if Ceva = idYES then
DelTree('{userdocs}\myfolder', True, True, True);
end;
end;
For some reason the "{userdocs}" constant appear not to be working. If i put the exact path to the folder "DelTree('C:\Users\myuser\Documents\myfolder', True, True, True); " everything is working fine.