user1827055
user1827055

Reputation: 23

NSIS Change Header Image Based on Language Selection

I am using NSIS to create an installer. How can I change the header image (MUI_HEADERIMAGE_BITMAP) based on the users language selection at install?

Upvotes: 2

Views: 717

Answers (1)

Anders
Anders

Reputation: 101756

!define MUI_HEADERIMAGE
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
!include MUI2.nsh
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
...
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE Swedish

Function .onInit
    !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

Function myGUIInit
    InitPluginsDir
    ${If} ${LANG_ENGLISH} = $Language
        File "/oname=$PluginsDir\langspecifichdr.bmp" "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
    ${Else}
        File "/oname=$PluginsDir\langspecifichdr.bmp" "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
    ${EndIf}
    SetBrandingImage /IMGID=1046 "$PluginsDir\langspecifichdr.bmp"
FunctionEnd

Upvotes: 1

Related Questions