Archive: Multiple languages and showing messages from .onInit


Multiple languages and showing messages from .onInit
Hello!

I have a simple problem: I want my installer to do the following:

1) Prompt for the language the user wants to use
2) Check if it makes sence to install the program: Check that we can indeed install on this computer. Also, if the program is already installed then prompt the user and then call the uninstaller.

Point 1 has to be done from .onInit, for example by:

!insertmacro MUI_LANGDLL_DISPLAY

If I do point 2 from .onInit, however, the installer will not use the right language when talking with the user.

Are there any suggestions on how to overcome this problem?

One idea is to make a callback function for the first page to be displayed and then execute point 2 there. However, if I call abort from such a callfunction this will not abort the installation but only the first page.


In .onInit use $LANGUAGE variable. And try search for forum with "multilanguage", "Message" or "MessageBox" -> this problem was discussed.

EDIT: Try this link.


Thank you! It works now. The suggestion I used from the thread was to use .onGUIinit (or more precisely, MUI_CUSTOMFUNCTION_GUIINIT )


I use code like this:


var mess
....
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
StrCmp $LANGUAGE 1049 0 eng
StrCpy $mess "Òåêñò ñîîáùåíèÿ"
eng:
StrCmp $LANGUAGE 1033 0 ;other
StrCpy $mess "Message text"
;other:

MessageBox MB_OK "$mess"

FunctionEnd