Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th June 2010, 10:03   #1
Stieven76
Junior Member
 
Join Date: Jun 2010
Posts: 6
Exclamation Add custom string to Language file

Hi,

In my installation proces it can be that there are some messageboxes shown.
Now I have set the message text hardcoded in the installer, but how can I use a string var for it?
See example:
MessageBox "MB_OK" "This program requires Microsoft Windows XP or later"
MessageBox MB_YESNO|MB_ICONQUESTION "$(RemoveOldVersionQuestion)" IDNO LblCheckDone

In what file and where do I need to put the langstring "RemoveOldVersionQuestion"?

Thx for any help!!
Stieven76 is offline   Reply With Quote
Old 30th June 2010, 12:38   #2
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Xi'an, China
Posts: 194
Using LangString.

LangString ERROR_TEXT 1033 'Missing a required file!'
LangString ERROR_TEXT 2052 '缺少必要的文件!'

or:

LangString ERROR_TEXT ${LANG_ENGLISH} 'Missing a required file!'
LangString ERROR_TEXT ${LANG_SIMPCHINESE} '缺少必要的文件!'

MessageBox MB_OK|MB_ICONSTOP "$(ERROR_TEXT)"

Setup will automatically show the proper text based on the language of user's OS.
jiake is offline   Reply With Quote
Old 30th June 2010, 12:43   #3
Stieven76
Junior Member
 
Join Date: Jun 2010
Posts: 6
Hi Jake,

Thx for your reply.
Isn't it possible that I add the string variable to say Dutch.nsh file and call it from there?
We have nine languages to support so it would be great if I could add them to their resp. language file.
Stieven76 is offline   Reply With Quote
Old 30th June 2010, 22:50   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
I wouldn't because you will then get warnings when using the language files in other scripts that do not use your added language string. If you want, create your own additional nsh files.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 30th June 2010, 23:54   #5
redxii
Senior Member
 
Join Date: Nov 2005
Posts: 113
Just create "dutch.nsh" and just include it:

!addincludedir .

...

!insertmacro MUI_LANGUAGE "Dutch"

!include Dutch.nsh

Though I use this "format" so I don't have to put ${LANG_DUTCH} or the #### throughout:

PHP Code:
!insertmacro LANGFILE "Dutch" "Nederlands"

${LangFileStringERROR_TEXT "There was an error." 
and !insertmacro LANGFILE_INCLUDE "translations\dutch.nsh" to include it.
redxii is offline   Reply With Quote
Reply
Go Back   Winamp 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