Skip to content
⌘ NSIS Forum Archive

Install in the directory of installer

5 posts

timecop12#

Install in the directory of installer

Hi all,

how can I set the $INSTDIR to the same
directory as the installer file is.

Example:
C:\downloads\myinstaller.exe
$INSTDIR = C:\downloads

It sould be the current path of the installer file.

Thanks
- timecop
kichik#
Use the GetParent function to get the parent directory of any file. Finding the file is up to you. It can be done searching the hard disk, reading from the registry or any other file. If you need help figuring out how a certain way post back here and someone will surely be able to help.
timecop12#
Very fast answer! Thanks.
Now, I was looking in the documentation and I think
InstallDir $EXEDIR
is the an easier way.