Skip to content
⌘ NSIS Forum Archive

FileSearch function

4 posts

TJK#

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
Animaether#
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.
ssam#
Use FileSearch



there i found how can i use the function

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


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
.
.
.