$EXEDIR doesn't work, hard-coded path does.
Hi.
I'm new to this forum (which is excellent by the way, it contains a lot of information). I've been using NSIS for about 3 weeks, but now I stumbled upon something that I could not find an answer to in the help-docs or this forum.
I use the following code to copy some PDF files to the installation folder:
!define DOCUMENTATION_SOURCES "Documentation"
Function InstallDocumentation
; copy documentation.
CreateDirectory "$INSTDIR\${MAINPRODUCT_DEST}\Documentation"
SetOutPath "$INSTDIR\${MAINPRODUCT_DEST}\Documentation"
ClearErrors
File /nonfatal /r "C:\work\installers\Deploy\${DOCUMENTATION_SOURCES}\*.pdf"
MessageBox MB_OK "C:\work\installers\Deploy\${DOCUMENTATION_SOURCES}\*.pdf"
File /nonfatal /r "$EXEDIR\${DOCUMENTATION_SOURCES}\*.pdf"
MessageBox MB_OK "$EXEDIR\${DOCUMENTATION_SOURCES}\*.pdf"
IfErrors cannot_install
Return
cannot_install:
Call HandleInstallationError
Abort
FunctionEnd
(I can't seem to get indents on the forum...)
When I compile my code, the compiler gives the following warning:
File: "$EXEDIR\Documentation\*.pdf" -> no files found. (filename.nsh:270)
When I run the code, the two MessageBoxes contain the same output: C:\work\installers\Deploy\Documentation\*.pdf
However, using the File command containing $EXEDIR doesn't copy any documents to the output folder, while using the File command containing the hard-coded folder does.
What am I missing here?