Jim Bosworth
3rd October 2005 15:02 UTC
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
Afrow UK
3rd October 2005 15:04 UTC
Use $EXEDIR\files\sys\plugins
-Stu
Jim Bosworth
3rd October 2005 15:13 UTC
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
Afrow UK
3rd October 2005 15:54 UTC
If you have to use relative paths (which I would not recommened) use SetOutPath $EXEDIR to set the correct working directory first.
-Stu
Instructor
3rd October 2005 16:55 UTC
I see no relative path problem. Make sure that "..\files\sys\plugins" exists, put this code before Locate function call:
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"
Jim Bosworth
4th October 2005 08:23 UTC
You are right, Instructor. Your function works fine. I made a stupid mistake and found out just now. My apologies!
Thanks again
Jim