Old 24th June 2005, 11:02   #1
fabiochelly
Senior Member
 
fabiochelly's Avatar
 
Join Date: Nov 2003
Location: Vincennes, France
Posts: 122
Send a message via ICQ to fabiochelly
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.

code:
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


Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
fabiochelly is offline   Reply With Quote
Old 24th June 2005, 11:06   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Search the forum for "oninit langstring" and find:

http://forums.winamp.com/showthread....nit+langstring
http://forums.winamp.com/showthread....nit+langstring
http://forums.winamp.com/showthread....nit+langstring
http://forums.winamp.com/showthread....nit+langstring

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
Old 24th June 2005, 11:17   #3
fabiochelly
Senior Member
 
fabiochelly's Avatar
 
Join Date: Nov 2003
Location: Vincennes, France
Posts: 122
Send a message via ICQ to fabiochelly
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?

Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
fabiochelly is offline   Reply With Quote
Old 24th June 2005, 11:20   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Using Quit.

Don't forget the custom page won't show in silent mode. You should add a check for that in .onInit.

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
Old 24th June 2005, 11:25   #5
fabiochelly
Senior Member
 
fabiochelly's Avatar
 
Join Date: Nov 2003
Location: Vincennes, France
Posts: 122
Send a message via ICQ to fabiochelly
Thank you very much. Finally, I replaced my LangString lines by tests. It's simpler as I only have one message string:
code:
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


Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
fabiochelly 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