Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 3rd October 2005, 14:02   #1
Jim Bosworth
Guest
 
Posts: n/a
Locate function - bug with relative paths?

Hi all!

There seems to be a bug in the Locate Function in FileFunc.nsh.

If I call it like this it works perfectly:

${Locate} "C:\installer\files\sys\plugins" "/M=com.fsp.f20.fu20.common_*" "getDirFullPath"

If I try this (and this is what I actually need, unfortunately) it doesn't:

${Locate} "..\files\sys\plugins" "/M=com.fsp.f20.fu20.common_*" "getDirFullPath"

Is there a work-around or a fix that one of you could offer?

Thanks in advance

Jim
  Reply With Quote
Old 3rd October 2005, 14:04   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Use $EXEDIR\files\sys\plugins

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 3rd October 2005, 14:13   #3
Jim Bosworth
Guest
 
Posts: n/a
Hmm, unfortunately I have to use a relative path. All the install script can be sure of at execution time is that the "files" directory will be next to it: ..\files.

Jim
  Reply With Quote
Old 3rd October 2005, 14:54   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
If you have to use relative paths (which I would not recommened) use SetOutPath $EXEDIR to set the correct working directory first.

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 3rd October 2005, 15:55   #5
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 665
I see no relative path problem. Make sure that "..\files\sys\plugins" exists, put this code before Locate function call:
code:

IfFileExists "..\files\sys\plugins\*.*" +2
MessageBox MB_OK "This directory isn't exist"

${Locate} "..\files\sys\plugins" "/M=com.fsp.f20.fu20.common_*" "getDirFullPath"



If it not exist, use like say Afrow UK "SetOutPath $EXEDIR"
Instructor is offline   Reply With Quote
Old 4th October 2005, 07:23   #6
Jim Bosworth
Guest
 
Posts: n/a
You are right, Instructor. Your function works fine. I made a stupid mistake and found out just now. My apologies!

Thanks again

Jim
  Reply With Quote
Reply
Go Back   Winamp 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