Skip to content
⌘ NSIS Forum Archive

Script path

6 posts

ryo-oh-ki#

Script path

Lets assume that our script was "!include"d from another. How to get file path of our script from within script itself?
MSG#
I'm not sure if this is even possible. But there's probably another solution to what you want to accomplish. Why do you want the file path of the included script?
ryo-oh-ki#
Because of other files placed near and used by this script. I want something like "library" script.
MSG#
Hmm, I just looked at compiletime commands and found this: http://nsis.sourceforge.net/Docs/Chapter5.html#5.2.1

I tried it, and they work per-file as they should, so you should use "${__FILEDIR__}\${__FILE__}". However, my compiler states that filedir isn't a known constant... Perhaps it's an NSIS 3 constant?
MSG#
Hasn't been released yet, and won't be for some time to come. Some future commands made their way into the online manual, probably because it's linked against the SVN repo I guess.

For now, I guess you'll have to pass the directory as a command line parameter to the compiler (/d parameter)?