Changing $LANGUAGE in .onInit
I have a single installer which, supports multiple languages. This enables us to give the user a single download, which uses the matching language which the website also uses.
The problem I am having is that given the following code:
LangString HELLOWORLD ${LANG_ENGLISH} "English"
LangString HELLOWORLD ${LANG_GERMAN} "German"
Function .OnInit
StrCpy $LANGUAGE "${LANG_GERMAN}"
MessageBox MB_OK "$(HELLOWORLD)"
FunctionEnd
The MessageBox would display "English" and not "German", in the .OnInit function, however once in an installer Section, a MessageBox would then show correctly "German".
Checking the values in $LANGUAGE it is correctly set to German in the .OnInit function.
It is very odd, any ideas about this? Is the .OnInit function supposed to work like this?