Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 4th December 2006, 14:03   #1
jdannenb
Junior Member
 
Join Date: Apr 2006
Posts: 13
Question Section selection depending on language

Hi, after searching this forum (maybe not good enough?) I'm still facing this problem:

I've got several sections which are installed depending on the chosen installer language.

Section "Bla ENG" SEC_BLA_ENG
<stuff to install for english language>
SectionEnd

Section "Bla GER" SEC_BLA_GER
<stuff to install for german language>
SectionEnd
(...many more language depending sections...)

I 've written a litte macro for helping me in selecting/unselecting these sections, using Sections.nsh:

# Macro for selecting language specific sections
!macro SELECT_SECTION GERMAN_SECTION_ID ENGLISH_SECTION_ID
StrCmp $LANGUAGE ${LANG_GERMAN} German${GERMAN_SECTION_ID} English${ENGLISH_SECTION_ID}
German${GERMAN_SECTION_ID}:
!insertmacro SelectSection ${GERMAN_SECTION_ID}
!insertmacro UnselectSection ${ENGLISH_SECTION_ID}
Goto done${GERMAN_SECTION_ID}
English${ENGLISH_SECTION_ID}:
!insertmacro SelectSection ${ENGLISH_SECTION_ID}
!insertmacro UnselectSection ${GERMAN_SECTION_ID}
done${GERMAN_SECTION_ID}:
!macroend

In my .onInit, I call the macro like this:
(...)
!insertmacro MUI_LANGDLL_DISPLAY
!insertmacro SELECT_SECTION SEC_BLA_GER SEC_BLA_ENG
!insertmacro SELECT_SECTION SEC_BLA_GER2 SEC_BLA_ENG2
(...)

But...disregarding the chosen language, ALL sections are installed. What am I doing wrong?

Help really appreciated.
Greez
Jens
jdannenb is offline   Reply With Quote
Old 5th December 2006, 03:51   #2
n_baua
Member
 
Join Date: Aug 2006
Posts: 86
Hi jdannenb,

have you tried with "one-section.nsi" example in NSIS installations example folder...?
May be this is what you are looking for.
n_baua is offline   Reply With Quote
Old 5th December 2006, 04:07   #3
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
Lightbulb

Hi Jens!

You have to treat the section descriptors as constants.

code:

!insertmacro SELECT_SECTION ${SEC_BLA_GER} ${SEC_BLA_ENG}



Have a nice day!

Cheers

Bruno
bholliger is offline   Reply With Quote
Old 5th December 2006, 07:21   #4
jdannenb
Junior Member
 
Join Date: Apr 2006
Posts: 13
Hi Bruno, thanks for your reply.
I tried it, but unfortunately to no avail.
I switched over to LogicLib now.

Section "Bla ENG" SEC_BLA_ENG
${If} $LANGUAGE == ${LANG_ENGLISH}
<stuff to install for english language>
${EndIf}
SectionEnd

This works for me. But, I think this has the disadvantage that I am not controlling the language dependencies in a central place like .onInit
Well never mind, it's working and I won't get fired

Greez
Jens
jdannenb is offline   Reply With Quote
Old 5th December 2006, 08:11   #5
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
Lightbulb

Hi Jens!

This works for me. You might try this as well...

Have a nice day!

Tschuess!

Bruno
Attached Files
File Type: nsi test30.nsi (1.3 KB, 92 views)
bholliger is offline   Reply With Quote
Old 5th December 2006, 09:01   #6
jdannenb
Junior Member
 
Join Date: Apr 2006
Posts: 13
Gruezi Bruno
Excellent, thank you

Greez
Jens
jdannenb 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