Old 31st January 2008, 01:01   #1
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Why Language string is not allowed in File instruction?

Take this nsi script for example:
code:

!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:

Quote:
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?
chjfth is offline   Reply With Quote
Old 31st January 2008, 07:24   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Is there any reason to use that in file instruction?

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 31st January 2008, 09:26   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Language strings are run time. File is compile time.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump