Archive: Script path


Script path
Lets assume that our script was "!include"d from another. How to get file path of our script from within script itself?


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?


Because of other files placed near and used by this script. I want something like "library" script.


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?


Where I can get NSIS v3? Thank You.


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)?