Archive: Why Language string is not allowed in File instruction?


Why Language string is not allowed in File instruction?
Take this nsi script for example:


!define ENG 1033

LangString TEST_FILE ${ENG} "example1.nsi"

; The name of the installer
Name "Example1"

; The file to write
OutFile "example1.exe"

; The default installation directory
InstallDir $PROGRAMFILES\Example1

;--------------------------------

; Pages

Page directory
Page instfiles

;--------------------------------

; The stuff to install
Section "" ;No components page, name is not important

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File "$(TEST_FILE)" ;Using $(LangVar) is not allowed here, NSIS v2.33
DetailPrint "Well, $(TEST_FILE) done."

SectionEnd ; end the section


When compiling(NSIS v2.33), error occurs:

File: "$(TEST_FILE)" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
/oname=outfile one_file_only)
Error in script "E:\Program Files\NSIS\Examples\example1.nsi" on line 30 -- aborting creation process
Is there any reason $(TEST_FILE) is not allowed in File instrction?

Is there any reason to use that in file instruction?


Language strings are run time. File is compile time.

Stu