Old 15th February 2006, 14:02   #1
paolof
Junior Member
 
Join Date: Feb 2006
Posts: 5
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.
paolof is offline   Reply With Quote
Old 19th February 2006, 17:36   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
There's no attachment, please try again.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 20th February 2006, 13:42   #3
paolof
Junior Member
 
Join Date: Feb 2006
Posts: 5
Sorry !
Attached Files
File Type: nsi test.nsi (1.3 KB, 342 views)
paolof is offline   Reply With Quote
Old 24th February 2006, 10:22   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 24th February 2006, 11:27   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Well spotted kichik
Please download RecFind.nsh again.

-Stu
Afrow UK is offline   Reply With Quote
Old 24th February 2006, 11:42   #6
paolof
Junior Member
 
Join Date: Feb 2006
Posts: 5
Many thanks kichik and Afrow, I've just downloaded and it works perfectly.

Thanks again
paolof is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump