Archive: losing my mind...strloc


losing my mind...strloc
  I am loading StrFunc, and i thought nothing of adding

${StrLoc} $0 $ThisString "\" ">"

to my script in order to evaluate whether a \ exists in ThisString

but at compile time i get

!insertmacro: FUNCTION_STRING_StrLoc
!insertmacro: macro "FUNCTION_STRING_StrLoc" requires 0 parameter(s), passed 4!

I look in the StrFunc.nsh and the function looks fine, it wants to evaluate four parameters as expected.

am i losing my mind? Feels that way... it's gotta be something obvious that i'm missing..


OK, every function for StrFunc that i call is giving me the same message.

Other functions work, i can't see why this one won't.
I see it loading without error during the includes, and obviously NSIS has the macros available, but when they are called they are just...broken. wtf is going on here.

${StrStrAdv} $ServerName $name "\" ">" "<" "0" "0" "0"

!insertmacro: FUNCTION_STRING_StrStrAdv
!insertmacro: macro "FUNCTION_STRING_StrStrAdv" requires 0 parameter(s), passed 8!

And before someone asks, yes, i've tried using other 'normal' strings instead of "\"

Tried reinstalling NSIS, no luck.

Really confused. I need these functions.


I was able to use the StrStrAdv from the wiki as a workaround, but I'd like to get StrFunc back and working properly if possible.


From the StrFunc doc:

Every command used in install sections and functions have to be called first before and out of any sections and functions, and without parameters.
Did you do this?
If not your error will show.

This should be a working example:

OutFile testsetup.exe


>!include "StrFunc.nsh"

${StrStr} # Supportable for Install Sections and Functions

${UnStrStr} # Supportable for Uninstall Sections and Functions

Section

${StrStr} $0 "OK! Now what?" "wh"

SectionEnd

Section Uninstall

${UnStrStr} $0 "OK! Now what?" "wh"

SectionEnd
>