NSIS基于语言选择改变标题图像

时间:2012-11-15 15:09:08

标签: nsis

我正在使用NSIS创建安装程序。如何根据安装时的用户语言选择更改标题图像(MUI_HEADERIMAGE_BITMAP)?

1 个答案:

答案 0 :(得分:1)

!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