Skip to content
⌘ NSIS Forum Archive

LicenseLangString in Modern UI

7 posts

robertpnl#

LicenseLangString in Modern UI

Hi,

I'm trying to create a install script with multi-language and with the modern UI. During installation, the page of EULA must be displayed. This works, but...

By starting installation, the user can select one of the available languages (Dutch or English). After then, when the EULA displays, only the Dutch EULA is showing. If the user choose English, also then the Dutch EULA is displayed.

During compiling I've got two warnings:
2 warnings:
LicenseLangString "lics" set multiple times for 0,
wasting space (..:43)
LangString "lics" is not set in language table of
language Dutch

A piece of code:


; Modern UI
!include "MUI.nsh"

; LicenseLang
LicenseLangString lics $(LANG_ENGLISH) "English.rtf"
LicenseLangString lics $(LANG_DUTCH) "Dutch.rtf"

; Screens
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(lics)
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

; Uninstall screen
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

; Language
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Dutch"
I don't get it why I got the two warnings and only the Dutch RTF is showing. Can someone please help me?

Greets
Robert-Paul
robertpnl#
Originally posted by Joost Verburg
Add these strings after inserting the language files.
Hi Joost,

Thank you for your reply, but it doesn't help.

Here the whole script (excep the sections):


; Modern UI
!include "MUI.nsh"

Name "Test_ML 1.0"
OutFile "Setup.exe"
InstallDir "$PROGRAMFILES\Test\"
!define MUI_ABORTWARNING

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

; Screens
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(MUILicense)
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

; Uninstall screen
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

; Language
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Dutch"

; LicenseLang
LicenseLangString $(MUILicense) $(LANG_ENGLISH) "English.rtf"
LicenseLangString $(MUILicense) $(LANG_DUTCH) "Nederlands.rtf"

!insertmacro MUI_RESERVEFILE_LANGDLL

Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

Section ""
...
SectionEnd

Section "Uninstall"
...
SectionEnd

Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
I don't get it. What is wrong? The both .nlf are in de same directory.

Thanks
Robert-Paul
Afrow UK#
LicenseLangString $(MUILicense) $(LANG_ENGLISH) "English.rtf"
LicenseLangString $(MUILicense) $(LANG_DUTCH) "Nederlands.rtf"

should be

LicenseLangString MUILicense $(LANG_ENGLISH) "English.rtf"
LicenseLangString MUILicense $(LANG_DUTCH) "Nederlands.rtf"

No parenthesis.

-Stu
robertpnl#
Originally posted by Afrow UK
LicenseLangString $(MUILicense) $(LANG_ENGLISH) "English.rtf"
LicenseLangString $(MUILicense) $(LANG_DUTCH) "Nederlands.rtf"

should be

LicenseLangString MUILicense $(LANG_ENGLISH) "English.rtf"
LicenseLangString MUILicense $(LANG_DUTCH) "Nederlands.rtf"

No parenthesis.

-Stu
Hi Afrow,

Thank you for your reply. But changing the both lines, the problem still repeated. This doesn't work.

I get the next warning again:
- Generating language tables... warning:
- LangString "MUILicense" is not set in language table of
language English
And when I choose for English installation language, no EULA is displayed.

This makes me crazy. Help me..

Robert-Paul