Old 16th September 2008, 13:26   #1
XRaptor
Junior Member
 
Join Date: Sep 2008
Posts: 5
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?

Quote:

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
XRaptor is offline   Reply With Quote
Old 16th September 2008, 16:57   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Language strings use the first selected language in .onInit. You can either wait for .onGUIInit or use the good old ${Switch} on $LANGUAGE.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump