Skip to content
⌘ NSIS Forum Archive

Locate Problem

3 posts

aemik#

Locate Problem

I use this

Function Page
${While} $x < 5
  IntOp $x $x + 1
  ${ConfigRead} "filelist.ini" "ProgramFiles $x = " $FILENAME
  ${Locate} "$DIR" "/L=F /M=$FILENAME" "Location"
  call Location
  CopyFiles "$FILENAME" "$FILEDIR"
 ${Endwhile}
Functionend
Function Location
StrCpy $FILEDIR $R9
Functionend 

I have a problem with the locate-macro. When I search for the path of a file, the locatemacro sends the variable $R9 to an other Function. I try the get it back with "call Location"; but then I am out of my while function.
When I start the Installer it crashes.

Help please
kichik#
You don't have to call the Location function, the ${Locate} macro does that for you for every file it finds.

The above code doesn't work because you didn't implement the function according to the interface. The ${Locate} macro requires you to push anything but "StopLocate". Use Push "" after you copy over $R9.