Archive: Recursively process files in folder and its subfolders.


Recursively process files in folder and its subfolders.
Hi all,

i am using


FindFirst $0 $1 "${GACPath}\*.dll"
;loop:
StrCmp $1 "" +7
nsExec::ExecToStack '"$R1\gacutil.exe" /i "${GACPath}\$1" /nologo'
Pop $8
Pop $9
DetailPrint "$1: $9"
FindNext $0 $1
Goto -6
;done:

to add all DLLs in a certain directory to the assembly cache.

Now sometimes that directory can have one or more subdirectoris that also contain dlls that need to be added.

Any ideas how i cold recurse into those subdirectories?

Thanks for your help.

put all that code in a function, when you detect a folder (file exist check with "path\*"), call "yourself" (with path on the stack)


You mean use IfFileExists? How wold i detect the "second" folder then?

May i ask for a little example, please.


no.. he means that you should put it all in a function and, when you find a folder, call that function itself with the path of that folder as its starting point.

Try this wiki category... there's several macros and functions in there that deal with recursing through a path:
http://nsis.sourceforge.net/Category...File_Functions


Thanks, i have done it using

http://nsis.sourceforge.net/Search_f..._(Alternative)