Socrate
5th December 2007 17:39 UTC
StrCpy & File
Hello
I'm a newbie with NSIS. I try to put in the installer a specific file "readme_fr.txt". So I tried the following code :
StrCpy $R1 "readme"
StrCpy $R1 "_fr"
StrCpy $R1 ".txt"
DetailPrint "ici $R1"
File "$R1"
In the Output window :
DetailPrint: "ici $R1"
File: "$R1" -> no files found.
How can I proceed ? Thanks for your help.
Rafik
5th December 2007 18:01 UTC
Howdy
I believe you can put into installer only files which names are known at compilation time. File must be available on compilation machine.
so for example using defines is allright:
!define MY_FILE "readme_fr.txt"
File "${MY_FILE}"
because define value is known during compilation, but
passing an variable which value is not known until runtime is forbidden.
Greets
Rafał
Socrate
6th December 2007 08:26 UTC
Thanks Rafik for your quick reply.
I have another question about my problem. Now I want to put in my file the language. So I define the language like that :
LangString langue ${LANG_ENGLISH} "En"
LangString langue ${LANG_FRENCH} "Fr"
!define MY_FILE "readme_"
StrCpy MY_FILE $(langue)
StrCpy MY_FILE ".txt"
File "${MY_FILE}"
And I have an erreor : Usage: StrCpy $(user_var: output) str [maxlen] [startoffset]
Could you help me again please ?