bukox
23rd June 2007 13:47 UTC
Inserting language string
Hello.
First, sorry for my English:)
Second, I tried to find answer by searching but I didnt't find it.
I have problem with using language string in another string.
I put macro:
!insertmacro MUI_LANGUAGE "Polish"
include language file:
!include "installer\pp_polish.nsh"
and try to use it in another string:
File /oname=file.exe "include\file$(^LANG_PREFIX).exe"
but I revieve error that the file notepad2$(^LANG_PREFIX).exe doesn't exists. The file is named filePL.exe and if I insert PL insetad of $(^LANG_PREFIX) eveyrthing work correctly. How can I put language string in another string?
bye...
Afrow UK
23rd June 2007 19:03 UTC
Where did $(^LANG_PREFIX) come from?
$(MyLangString) is created if you use LangString MyLangString ...
Stu
bukox
23rd June 2007 19:14 UTC
$(LANG_PREFIX) doesn't work too. Still It raised "no files found" error. If I put plain text instead of lang string it works correctly. It's looks like the lang string isn't parsed when it is in another string.
bye...
Afrow UK
23rd June 2007 19:20 UTC
Please attach your nsh file.
Stu
bukox
23rd June 2007 19:27 UTC
I have 2 nsh files (polish and english). First lines from pp_polish.nsh:
LangString LANG ${LANG_POLISH} "Polish"
LangString LANG_PREFIX ${LANG_POLISH} "pl"
LangString InstallFull ${LANG_POLISH} "Pełna"
LangString InstallTypical ${LANG_POLISH} "Typowa"
and from pp_english.nsh:
LangString LANG ${LANG_ENGLISH} "English"
LangString LANG_PREFIX ${LANG_ENGLISH} "en"
LangString InstallFull ${LANG_ENGLISH} "Full"
LangString InstallTypical ${LANG_ENGLISH} "Typical"
And in nsi file I have:
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "English"
and
!include "installer\pp_polish.nsh"
!include "installer\pp_english.nsh"
bye...
Afrow UK
23rd June 2007 19:40 UTC
And what is your compile output...
Stu
bukox
23rd June 2007 19:49 UTC
I have line:
File /oname=test.exe "include\Tools\test$(LANG_PREFIX).exe"
and in this line I recieve:
File: "include\Tools\test$(LANG_PREFIX).exe" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
/oname=outfile one_file_only)
Error in script "D:\test\test.nsi" on line 191 -- aborting creation process
bye...
Afrow UK
23rd June 2007 19:55 UTC
Oh I see. No you cannot do that because language strings much like variables are for run time use (obviously). File is a compile time instruction which must be given hard coded parameters.
Hope that makes sense. You can only use defines at compile time.
Stu
bukox
23rd June 2007 20:37 UTC
Thx. Now I understand:)
bye...