Archive: Overriding standard MUI text strings


Overriding standard MUI text strings
Hi everyone,

Sometimes I want to override a MUI string... but I'm having some minor problems with it.

For example, if I do this:

!insertmacro MUI_LANGUAGE "English"
LangString MUI_TEXT_WELCOME_INFO_TITLE ${LANG_ENGLISH} "MyCompany Super Cool Program Installation"

then I get compile warnings:

LangString "MUI_TEXT_WELCOME_INFO_TITLE" set multiple times for 1033, wasting space

but otherwise this works.

The other option I've found is this:

LangString MY_WELCOME_TITLE ${LANG_ENGLISH} "Hello"
LangString MY_WELCOME_UN_TITLE ${LANG_ENGLISH} "Bye"

!define MUI_WELCOMEPAGE_TITLE "$(MY_WELCOME_TITLE)"
!insertmacro MUI_PAGE_WELCOME

!define MUI_WELCOMEPAGE_TITLE "$(MY_WELCOME_UN_TITLE)"
!insertmacro MUI_UNPAGE_WELCOME

but this is rather ugly with !define statements everywhere. Ideally I'd like to create an nsh file with all of my string overrides in it, and just have all of my nsi files include it.

Thanks

-- graham


You can make a modification to your "NSIS\Contrib\Modern UI\Language Files\English.nsh" and include it in your program.


Yes, but then I'd have to make sure that patch was applied on all of my coworkers' systems too. So then this becomes a maintenance issue, which we definitely don't need.


You can put those defines (you don't need a LangString if you only have one language) is a separate .nsh file and include it:

!include "Defines.nsh"