Archive: Problem with MultiLanguage


Problem with MultiLanguage
Hi,

I have two languages for my Installer. For that I created 2 lnaguage fils. They are called "MyInstallerEnglish" and "MyInstallerGerman".

So the Language selection dialog do not apear. Only if I create a new page befor the MUI_PAGE_WELCOME. Then I can choose the language.

Can anybody help me?

bumpelwumpel


!include "MUI2.nsh"

Name "MultiLanguage Test"
OutFile "MultiLanguage.exe"
InstallDir "$LOCALAPPDATA\MultiLanguage Test"

;Remember Installer Language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

;Pages
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

;Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"

;Reserve Files
!insertmacro MUI_RESERVEFILE_LANGDLL

;Install Sections
Section "Dummy Section" SecDummy
;ADD YOUR OWN FILES HERE...
SectionEnd

;Display Language Dialog
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

You have added the settings to store the language preference in the registry, this is why the dialog is not shown. If you want the dialog to be displayed anyway (with the registry preference as default), define MUI_LANGDLL_ALWAYSSHOW.


Yes, I forgot that in my sample code. Without MUI_LANGDLL_ALWAYSSHOW, the language dialog will appear only the first time the installer is run. Then the selected language is stored in registry and the language dialog won't appear again. If you add MUI_LANGDLL_ALWAYSSHOW, the dialog will always be shown, but the stored language is marked by default.


Ok, I have now changed the UI. Now I use the UMUI and this works great.