Archive: LangString and .onInit


LangString and .onInit
Hi, I need to use MessageBox in .onInit part for telling user some information and maybe abort install process. I need to display language specific message. But it not works, it always display the same string, no matter which language is selected. Is there any way without using variables and testing $LANGUAGE?


LangString MSG1 ${LANG_CZECH} "yyy"
LangString MSG1 ${LANG_ENGLISH} "xxx"

...

Function .onInit

!insertmacro MUI_LANGDLL_DISPLAY

ReadRegStr $R0 HKLM \
"SOFTWARE\something" \
"something"

${If} $R0 == ""
;MessageBox MB_OK $(MSG1) IDOK
Abort
${EndIf}

FunctionEnd

Language strings use the first selected language in .onInit. You can either wait for .onGUIInit or use the good old ${Switch} on $LANGUAGE.