RecFind.nsh and RmDir
In my uninstall section I need to perform some operation with the files in the subdirectories of $INSTDIR. To navigate the files I use the RecFind.nsh macro (here). Then I want to remove all the subdirectories (RmDir /R).
...
${RecFindOpen} "$INSTDIR\SUB" $R0 $R1
DetailPrint "dir: $R0"
${RecFindFirst}
DetailPrint "File: $INSTDIR\SUB$R0\$R1"
; Some operations with the file (not important)
${RecFindNext}
${RecFindClose}
SetOutPath $TEMP
RmDir /r $INSTDIR\SUB
...
Now suppose the following structure (A and B are directories):
$INSTDIR\SUB\A\
$INSTDIR\SUB\B\
If I uninstall my program only the directory A will be deleted. If I skip the RecFindOpen...RecFindClose RmDir work properly and the whole SUB directory will be deleted.
The attached file is a script that shows the problem.
Please help me. Thanks.