Old 5th October 2006, 16:25   #1
TJK
Junior Member
 
Join Date: Jun 2006
Posts: 17
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:
Quote:
Exch $2 ;output number of lines
Exch 2
Exch $1 ;output yes/no
Exch
Exch $0 ;output count found
FunctionEnd
to:
Quote:
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
TJK is offline   Reply With Quote
Old 6th October 2006, 09:14   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
I concur - I've edited the wiki.

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

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.
Animaether is offline   Reply With Quote
Old 3rd July 2008, 08:19   #3
ssam
Member
 
Join Date: May 2008
Posts: 60
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:

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

ssam is offline   Reply With Quote
Old 3rd July 2008, 10:35   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Check the usage on that page.

Stu
Afrow UK 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