tidus25
13th January 2009 10:43 UTC
browse folder to modify files
Hi
I made a setup that create a tree like that :
folder1
|_folder2
....|_web.config
....|_...
|_folder3
....|_web.config
....|_...
|_folder4
....|_web.config
....|_...
I would like to know if it's possible to browse the folder1 to look for all folder that contain the file web.config because I need to modify a parameter on each files
thx
Animaether
13th January 2009 12:24 UTC
Check into the FindFirst, FindNext and FindClose commands. You can check whether a found 'file' is a folder by checking for "<foundfile>\*.*" - if that returns true, it's a folder and you can then traverse that again (using a loop or a recursive function). Whenever you find the "web.config" file, adjust it from there.
Also see:
http://nsis.sourceforge.net/Category...File_Functions
Specifically:
http://nsis.sourceforge.net/Search_f...Alternative%29
That is a pre-built generic function that lets you search for a file/directory and whenever it finds that file/directory, it calls a callback function; you'd use that function to change the file.