Skip to content
⌘ NSIS Forum Archive

How to set the license file depending on the language

12 posts

Defcon0#

How to set the license file depending on the language

Hello,

how can I set the license file (RTF) in the license Dialog depending on the language chosen ?

Thanks.

BYe Defcon0.
Defcon0#
OK.
I've added
LicenseLangString license ${LANG_GERMAN} Lizenz.rtf
LicenseLangString license ${LANG_ENGLISH} Lizenz_eng.rtf
into the first 10 lines (after all the !define's).
And I've got one warning:

LicenseLangString "license" set multiple times for 0, wasting space (C:\Documents and Settings\Administrator\Desktop\Setup\Setup.nsi:18)

And the text isn't set to the right language 🙁
What am I doing wrong ?
CancerFace#
It would help if you included the actual code that breaks.
Did you insert this after defining the multiple license files?
LicenseData $(license)
You should probably have a look at the languages.nsi example in the ${NSISDIR}\Examples folder.
CF
Defcon0#
I read the languages.nsi but still no success
At first I forgot LicenseData $(license)
Now I have
LicenseLangString MyLicense ${LANG_GERMAN} "Lizenz.rtf"
LicenseLangString MyLicense ${LANG_ENGLISH} "Lizenz_eng.rtf"
LicenseData $(MyLicense)
after the !defines.
But what do I write instead of Lizenz.rtf here ?
!insertmacro MUI_PAGE_LICENSE "Lizenz.rtf"
CancerFace#
That should be
!insertmacro MUI_PAGE_LICENSE $(MyLicense)
and the correct file will be picked based on the system language
CF
Defcon0#
Mhm. Still doesn't work 🙁
I have:
LicenseLangString MyLicense ${LANG_ENGLISH} "Lizenz_eng.rtf"
LicenseLangString MyLicense ${LANG_GERMAN} "Lizenz.rtf"
LicenseData $(MyLicense)
!insertmacro MUI_PAGE_LICENSE $(MyLicense)
The warning:
2 warnings:
LicenseLangString "MyLicense" set multiple times for 0, wasting space (C:\Documents and Settings\Administrator\Desktop\Setup\Setup.nsi:40)
LangString "MyLicense" is not set in language table of language German

And when I pick English language it works and the English License Agreement is there and when I pick German the License Text field is empty.
Defcon0#
Here's the file.
Thanks 🙂
Comm@nder21#
LicenseLangString MyLicense ${LANG_ENGLISH} "Lizenz_eng.rtf"
LicenseLangString MyLicense ${LANG_GERMAN} "Lizenz.rtf"
these lines should be placed after those:
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
and the licenseData line should be removed as the MUI LICENSEPAGE macro will do it for ya.
CancerFace#
... and you are missing !insertmacro MUI_RESERVEFILE_LANGDLL

Check also Check ${NSISDIR}\Examples\Modern UI\MultiLanguage.nsi".

CF