Archive: FileSearch function


FileSearch function
Hi

I think I have found a problem in the FileSearch function - on exit $0 and $1 variables are swapped when compared on their settings on entry to the function.

I think that this can be fixed by changing the end of the FileSearch function from:

Exch $2 ;output number of lines
Exch 2
Exch $1 ;output yes/no
Exch
Exch $0 ;output count found
FunctionEnd
to:
Exch $2 ;output number of lines
Exch 2
Exch ; Add this line
Exch $1 ;output yes/no
Exch
Exch $0 ;output count found
FunctionEnd
Regards

Tim

I concur - I've edited the wiki.

However, rather than your proposal, I've made it this:


Exch $2 ;output number of lines
Exch
Exch $1 ;output yes/no
Exch 2
Exch $0 ;output count found
FunctionEnd

Which will have the same effect, but is an op less.

Use FileSearch
http://nsis.sourceforge.net/Search_for_text_in_file

there i found how can i use the function

http://forums.winamp.com/showthread....ght=FileSearch

there i saw how to call the function

but i get the error: "Error resolving function "FileSearch"


here is my code:


.
.
.
Push '$Apache_Path_to_Verify\conf\httpd.conf'
Push $specificInstallerString
Call ${FileSearch}
Pop $0 #Number of times found throughout
Pop $1 #Number of lines found on

StrCmp $0 0 ApacheConf_alreadypatched
.
.
.

Check the usage on that page.

Stu