I have three calls in a row for DelTree() in CurUninstallStepChanged()
for usPostUninstall
like this:
if IsDeleteAData then
begin
Res:=DelTree(AppData+'\ADirName', true, true, true);
Log('Delete '+AppData+'\ADirName result: '+IntToStr(Integer(Res)));
end;
if IsDeleteBData then
begin
Res:=DelTree(AppData+'\BDirName', true, true, true);
Log('Delete '+AppData+'\BDirName result: '+IntToStr(Integer(Res)));
end;
if IsDeleteCData then
begin
Res:=DelTree(AppData+'\CDirName', true, true, true);
Log('Delete '+AppData+'\CDirName result: '+IntToStr(Integer(Res)));
end;
A and B delete everything like it should. However, C will not delete the top level dir (the actual CDirName) but does delete the contents, if the CDirName is empty it will remove the CDirName directory itself.
If I enable logging all I get is that the result was 0 when it doesn't delete the top level directory.
It did this in 6.0.3 and now updated today to 6.2.0 and still doing it. Any ideas or way to dig in deeper? I've never had a problem with DelTree()
in the past.
I captured the process information and it basically just says CANNOT DELETE:
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"7:35:00.0095154 PM","_iu14D2N.tmp","1616","CreateFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"7:35:00.0095290 PM","_iu14D2N.tmp","1616","QueryBasicInformationFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","CreationTime: 10/6/2021 7:20:47 PM, LastAccessTime: 10/6/2021 7:30:50 PM, LastWriteTime: 10/6/2021 7:28:54 PM, ChangeTime: 10/6/2021 7:28:54 PM, FileAttributes: RD"
"7:35:00.0095347 PM","_iu14D2N.tmp","1616","CloseFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS",""
"7:35:00.0095902 PM","_iu14D2N.tmp","1616","CreateFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"7:35:00.0096079 PM","_iu14D2N.tmp","1616","QueryDirectory","C:\Users\testing\AppData\Roaming\CDirName\*","SUCCESS","Filter: *, 1: ."
"7:35:00.0096363 PM","_iu14D2N.tmp","1616","QueryDirectory","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","0: .., 1: desktop.ini, 2: Paint.lnk"
"7:35:00.0096876 PM","_iu14D2N.tmp","1616","CreateFile","C:\Users\testing\AppData\Roaming\CDirName\desktop.ini","SUCCESS","Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"7:35:00.0097112 PM","_iu14D2N.tmp","1616","QueryAttributeTagFile","C:\Users\testing\AppData\Roaming\CDirName\desktop.ini","SUCCESS","Attributes: HS, ReparseTag: 0x0"
"7:35:00.0097230 PM","_iu14D2N.tmp","1616","<Unknown>","C:\Users\testing\AppData\Roaming\CDirName\desktop.ini","SUCCESS",""
"7:35:00.0097332 PM","_iu14D2N.tmp","1616","CloseFile","C:\Users\testing\AppData\Roaming\CDirName\desktop.ini","SUCCESS",""
"7:35:00.0098645 PM","_iu14D2N.tmp","1616","CreateFile","C:\Users\testing\AppData\Roaming\CDirName\Paint.lnk","SUCCESS","Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"7:35:00.0098873 PM","_iu14D2N.tmp","1616","QueryAttributeTagFile","C:\Users\testing\AppData\Roaming\CDirName\Paint.lnk","SUCCESS","Attributes: A, ReparseTag: 0x0"
"7:35:00.0098956 PM","_iu14D2N.tmp","1616","<Unknown>","C:\Users\testing\AppData\Roaming\CDirName\Paint.lnk","SUCCESS",""
"7:35:00.0099040 PM","_iu14D2N.tmp","1616","CloseFile","C:\Users\testing\AppData\Roaming\CDirName\Paint.lnk","SUCCESS",""
"7:35:00.0099720 PM","_iu14D2N.tmp","1616","QueryDirectory","C:\Users\testing\AppData\Roaming\CDirName","NO MORE FILES",""
"7:35:00.0099817 PM","_iu14D2N.tmp","1616","CloseFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS",""
"7:35:00.0100469 PM","_iu14D2N.tmp","1616","CreateFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"7:35:00.0100652 PM","_iu14D2N.tmp","1616","QueryAttributeTagFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","Attributes: RD, ReparseTag: 0x0"
"7:35:00.0100727 PM","_iu14D2N.tmp","1616","<Unknown>","C:\Users\testing\AppData\Roaming\CDirName","CANNOT DELETE",""
"7:35:00.0100840 PM","_iu14D2N.tmp","1616","CloseFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS",""
Then I tried adding another RemoveDir
on usDone
and that still gave:
"7:35:01.7108218 PM","_iu14D2N.tmp","1616","CreateFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"7:35:01.7108617 PM","_iu14D2N.tmp","1616","QueryAttributeTagFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS","Attributes: RD, ReparseTag: 0x0"
"7:35:01.7108724 PM","_iu14D2N.tmp","1616","<Unknown>","C:\Users\testing\AppData\Roaming\CDirName","CANNOT DELETE",""
"7:35:01.7108875 PM","_iu14D2N.tmp","1616","CloseFile","C:\Users\testing\AppData\Roaming\CDirName","SUCCESS",""