Archive: RecFind.nsh and RmDir


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.


There's no attachment, please try again.


Sorry !


It's a bug with RecFind.nsh. It doesn't close the search handle when recursing into another directory. You should try another function or wait for Afrow to fix it.


Well spotted kichik :)
Please download RecFind.nsh again.

-Stu


Many thanks kichik and Afrow, I've just downloaded and it works perfectly.

Thanks again