Archive: Question about Dialogex


Question about Dialogex
Hello

I use the dialogex plugin to show a Password dialog in .OnInit
so far so good

Problem 1
How can i check which button the User clicked?
(Ok or Cancel) because if the user clicks cancel, I don't want to show the message "wrong password entered"...

Problem 2
The installer is multilingual
I put the Pwd Dialog after
"!insertmacro MUI_LANGDLL_DISPLAY"
But the call to
${InputPwdBox} "The Advanced Installer" $(PWD_DLG_MAINTXT) "" "15" "" "" 0
Always shows the default language! :(

Does I have to do this manually?
Because in the OnInit Function the Language Macros doesn't work?


Changing $LANGUAGE on .onInit, which is what MUI_LANGDLL_DISPLAY does, only takes affect after .onInit. You can use .onGUIInit (check out MUI readme how to define this, it uses this function on its own), which is called right after .onInit for non-silent installers.


Some correction
the $LANGUAGE is updated right after the MUI_LANGDLL_DISPLAY

So the code in the .onInit

!insertmacro MUI_LANGDLL_DISPLAY   

${Switch} $LANGUAGE
${Case} ${LANG_ENGLISH}
strcpy $R8 "Please, enter your password:"
${Break}
${Case} ${LANG_GERMAN}
strcpy $R8 "Bitte Passwort eingeben:"
${Break}
${EndSwitch}

Works fine! :D

If I use the build in functionality
It don't work :cry:

$LANGUAGE is updated, but it doesn't take effect until after .onInit. The built-in functionality, or language strings, don't change until after .onInit. By the time .onGUIInit is called, the language strings are changed to the language selected in .onInit.