Skip to content
⌘ NSIS Forum Archive

In .onInit langval does not get assigned, why?

8 posts

onad#

In .onInit langval does not get assigned, why?

Hi all, In .onInit a language different value does not get assigned to variable. It can be that I'm not yet fully awake, what could be my thinking mistake this morning?

Function .onInit

...

; NOT WORKING BELOW
StrCpy $9 "$(MUI_TEXT_FINISH_INFO_TITLE)"
MessageBox MB_OK "$9"

; BUT BELOW IS WORKING....
MessageBox MB_OK "$(MUI_TEXT_WELCOME_INFO_TITLE)"

...

FunctionEnd

I need this because of later on I want to do:

... LangString $9 $LANGUAGE $(MUI_TEXT_FINISH_INFO_TITLE)
Afrow UK#
Not sure what you are trying to do here, but LangString is a compile-time instruction.

-Stu
onad#
being

...

; NOT WORKING BELOW
StrCpy $9 "$(MUI_TEXT_FINISH_INFO_TITLE)"
MessageBox MB_OK "$9"

; BUT BELOW IS WORKING....
MessageBox MB_OK "$(MUI_TEXT_WELCOME_INFO_TITLE)"

Why?
Takhir#
What about this combined code 😉 ?

StrCpy $9 "$(MUI_TEXT_WELCOME_INFO_TITLE)"
MessageBox MB_OK "$9"
onad#
Well thank all, I think I have to clarify a little more, will make a test script to show what I mean, until then, all fine.
kichik#
If you're talking about .onInit and $LANGUAGE, you could only be talking about changes to $LANGUAGE not affecting LangStrings until after .onInit. That's how it works. LangStrings are updated twice - before .onInit and after it. You can use a switch in .onInit.