Old 11th May 2012, 12:04   #1
samsoumitta
Junior Member
 
Join Date: May 2012
Posts: 3
Unhappy Using translated message in .onInit

Hi,

I want have an english and frensh version for my installer, so do do that I use LangString for example:

code:
# Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

#Always show the language selection dialog, even if a language has been stored in the registry.
#The language stored in the registry will be selected by default.
!define MUI_LANGDLL_ALWAYSSHOW

# Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"

LangString message ${LANG_ENGLISH} "English message"
LangString message ${LANG_FRENCH} "message en français"




I want to use $(message) in function .onInit (but this don't work)
so what can I do
samsoumitta is offline   Reply With Quote
Old 11th May 2012, 12:10   #2
samsoumitta
Junior Member
 
Join Date: May 2012
Posts: 3
other question:
I use
code:
File /r "source_data\*.*"
to adds file(s) output path ($INSTDIR).

how can i delete installed files from $INSTDIR?
samsoumitta is offline   Reply With Quote
Old 11th May 2012, 15:26   #3
redxii
Senior Member
 
Join Date: Nov 2005
Posts: 115
Doesn't work in what way? You can use it in .oninit, I do in mine, and before you ask the user what language they want ( !insertmacro MUI_LANGDLL_DISPLAY ) it depends on the locale of the Windows installation. I tested for example with a German version of XP, before the selection dialogue it displays German message.

To delete a file is Delete, simple enough.
redxii is offline   Reply With Quote
Old 11th May 2012, 15:52   #4
samsoumitta
Junior Member
 
Join Date: May 2012
Posts: 3
code:
function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
MessageBox MB_OK "$(message)"
FunctionEnd



I select english language but the message is always shown in frensh (because i use frensh verion of XP)

and I want to list autaumatically installed files before deleting them without using delete "fileName" for every file
samsoumitta is offline   Reply With Quote
Old 11th May 2012, 23:32   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You cannot use language strings in .onInit, only after; e.g. you can use them in .onGUIInit (!define MUI_CUSTOMFUNCTION_GUIINIT myOnGUIInit) or in your first page's PRE function.

To generate a list of files to delete you can write a script to do it or write an NSIS executable to do it. Run it with !system then !include its output file.

Stu
Afrow UK 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