Archange
20th January 2004 10:04 UTC
Section & Subsection Subesction select
Hi, i can't manage my uninstaller section & sub
That's how it looks like (bigger in fact)
un.sec1
un.subsec2
_________un.asubsec
___________________un.asec1
___________________un.asec2
___________________un.asec3
___________________un.asec4
_________un.bsubsec
___________________un.bsec1
___________________un.bsec2
___________________un.bsec3
___________________un.bsec4
_________un.csec
_________un.dsec
I (only) need that :
if sec1 is selected then subsec2 is unselected (and all the tree)
if subsec2 is selected or partially selected through tree then sec1 is unselected
I've looked all the forum (really) for examples, one-section, basic etc.... tried by myself but no way it can't work... (moreover i'm really bad at nsis script...i'm getting better and better but for that i'm :down: )
ramon18
20th January 2004 11:54 UTC
Hi, if I understood well your problem, I don't know if its possible without deep changing NSIS engine,
because sec1 is parent of subsec2, if subsec2 is partial sec1 must be indeterminate, if subsec2 is entirely selected sec1 is selected too, this is standard in windows.
cyas
Archange
20th January 2004 11:58 UTC
i don't think sec1 is parent of subsec2.
It's like if there was sec1 & sec2 except sec2 contains other sections...
Joost Verburg
20th January 2004 12:44 UTC
This is possible using the Sections.nsh macros and the .onSelChange callback function.
Archange
20th January 2004 12:51 UTC
Originally posted by Joost Verburg
This is possible using the Sections.nsh macros and the .onSelChange callback function.
Thanks,
that's what i cannot manage to use :eek:
Could you give me an example for something like that :
un.sec1
un.subsec2
_________un.asubsec
___________________un.asec1
___________________un.asec2
_________un.bsec
Joost Verburg
20th January 2004 13:08 UTC
You can find details about the macros in that file.
SelectSection selects a section
UnSelectSection unselectes a secton
SectionFlagIsSet can be used to check whether a secton is selected (combined with the SF_SELECTED flag).
Archange
20th January 2004 13:19 UTC
:igor:
As i'm still at the same point, i post the onesection i've modified but that still doesnt work well (in fact it work in one way only....
; one-section.nsi
;
; This example demonstrates how to control section selection.
; It allows only one of the sections of a group to be selected.
;--------------------------------
; Section define/macro header file
; See this header file for more info
!include "Sections.nsh"
;--------------------------------
Name "One Section"
OutFile "one-section.exe"
;--------------------------------
; Pages
Page components
;--------------------------------
; Sections
Section /o "aaaa" g0o0
SectionEnd
SubSection "bbbb" ss1
Section "Group 1 - Option 1" g1o1
SectionEnd
Section "Group 1 - Option 2" g1o2
SectionEnd
SubSectionEnd
;--------------------------------
; Functions
; $1 stores the status of group 1
; $2 stores the status of group 2
Function .onInit
StrCpy $1 -1
FunctionEnd
Function .onSelChange
!insertmacro SectionFlagIsSet ${g0o0} ${SF_SELECTED} "" next
StrCmp $1 ${ss1} "" dontUnselect
!insertmacro UnselectSection ${ss1}
dontUnselect:
!insertmacro UnselectSection ${g1o1}
!insertmacro UnselectSection ${g1o2}
StrCpy $1 ${ss1}
next:
!insertmacro SectionFlagIsSet ${ss1} ${SF_SELECTED} "" next2
StrCmp $1 ${g0o0} "" dontUnselect2
!insertmacro UnselectSection ${g0o0}
dontUnselect2:
StrCpy $1 ${g0o0}
next2:
FunctionEnd
kichik
21st January 2004 21:14 UTC
Try this.
Archange
22nd January 2004 10:06 UTC
Thanks
Thanks a lot ;)
I'll post my section/subsection scripts when finished...if it can help...:p