Archive: Confused about OUTFILE/EXEDIR/INSTDIR


Confused about OUTFILE/EXEDIR/INSTDIR
Hi All,

I'm trying to make an installer where I have files which need to be copied over (obviously), but I'm not exactly sure about how to do it.

The structure is as follows: (*** = some common folder)

***/Installer/Myinstaller.nsi
***/Binaries/program.exe
***/Binaries/program.dll
***/Images/header.jpg

1) How do I specify to go back one folder and then include all of the program.exe, program.dll and header.jpg in the installer executable that will be compiled?

2) How do I specify that I want to copy the files from the installer executable to the installation directory that the user selects?

3) What is the difference between $INSTDIR, $OUTDIR, $EXEDIR, and SetOutPath ?

--------------------------------------------------------------

I was thinking of doing something like this to copy the files into the installer exe being created. But where do I put that? In some function? Globally? It needs to be done at compile time, doesn't it? And it says that the "File" command extracts the files, not that it includes the files for extraction later, so maybe I'm using the wrong function completely?


File ..\Binaries\program.exe
File ..\Binaries\program.dll
File ..\Images\header.jpg


Then how do I extract them to the user selected install directory?


CopyFiles <FromWhere?>\program.exe $INSTDIR\program.exe
CopyFiles <FromWhere?>\program.exe $INSTDIR\program.dll
CopyFiles <FromWhere?>\program.exe $INSTDIR\Images\header.jpg


Thanks for the help!

Re: Confused about OUTFILE/EXEDIR/INSTDIR

What is the difference between $INSTDIR, $OUTDIR, $EXEDIR, and SetOutPath ?
$INSTDIR, $OUTDIR and $EXEDIR are runtime variables. SetOutPath is a runtime command.

$INSTDIR contains the directory entered by the user on the DIRECTORY page. $EXEDIR contains the location of the installer executable. $OUTDIR contains the current file output directory.
SetOutPath changes the value of $OUTDIR. See the manual.

How do I specify that I want to copy the files from the installer executable to the installation directory that the user selects?
This is what the File command does. Example:
File ..\Binaries\program.exe
This command does two things. Upon compile time, this command will compress the exe on your development computer into the installer. On runtime, it will ALSO extract the file to the directory currently stored in $OUTDIR. (This is why the File command is used inside a section, and always after a SetOutPath command.)