Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Using translated message in .onInit (http://forums.winamp.com/showthread.php?t=344775)

samsoumitta 11th May 2012 12:04

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 11th May 2012 12:10

other question:
I use
code:
File /r "source_data\*.*"
to adds file(s) output path ($INSTDIR).

how can i delete installed files from $INSTDIR?

redxii 11th May 2012 15:26

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.

samsoumitta 11th May 2012 15:52

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

Afrow UK 11th May 2012 23:32

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


All times are GMT. The time now is 17:26.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.