fabiochelly
24th June 2005 11:02 UTC
LangString doesn't work in onInit event
I got a problem : the message $(DESC_SpadNotFound) is always shown in french even when I choose english in the language combobox.
LangString DESC_SpadNotFound ${LANG_ENGLISH} "Spad 6 has not been found on this computer!"
LangString DESC_SpadNotFound ${LANG_FRENCH} "Spad version 6 n'a pas été trouvé sur votre système !"
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
ClearErrors
ReadRegStr $0 HKLM "Software\Microsoft\Windows\App Paths\winspad60.exe\Path\" ""
${If} ${Errors}
MessageBox MB_OK|MB_ICONINFORMATION "$(DESC_SpadNotFound)"
Abort
${Else}
StrCpy $INSTDIR "$0"
${EndIf}
FunctionEnd
fabiochelly
24th June 2005 11:17 UTC
Thank you. The language problem is corrected.
But how can I abort the setup if I'm in a custom page and not in the .onInit function anymore?
kichik
24th June 2005 11:20 UTC
Using Quit.
Don't forget the custom page won't show in silent mode. You should add a check for that in .onInit.
fabiochelly
24th June 2005 11:25 UTC
Thank you very much. Finally, I replaced my LangString lines by tests. It's simpler as I only have one message string:
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
ClearErrors
ReadRegStr $0 HKLM "Software\Microsoft\Windows\App Paths\winspad60.exe\Path\" ""
${If} ${Errors}
${If} "$LANGUAGE" == "${LANG_FRENCH}"
MessageBox MB_OK|MB_ICONINFORMATION "Spad version 6 n'a pas été trouvé sur votre système !"
${Else}
MessageBox MB_OK|MB_ICONINFORMATION "Spad 6 has not been found on this computer!"
${EndIf}
Abort
${Else}
StrCpy $INSTDIR "$0"
${EndIf}
FunctionEnd