Archive: About Section Flags


About Section Flags
Hi people,

I cannot get this to work, I trying to make the install button on component page to be un-highlighted when two or more sections is not check.

Section /o AAA Dum1
SectionEnd

Section /0 BBB Dum2
SectionEnd

How can I make in such a way using "Function .onSelChange" to change the install button.

1.
if dum1 is selected or dum1 and dum2 is selected or dum2 is selected, the " install " button will be clickable.

2.
if dum1 and dum2 is not selected at all, the " install " button will never be able to click to proceed to install.

Thanks people who had been helping me.


Hi rxs2k5. Try this.

Add the below !define above your Components page macro:


!define MUI_PAGE_CUSTOMFUNCTION_SHOW ".onSelChange"
!insertmacro MUI_PAGE_COMPONENTS

Then add this function:

Function .onSelChange
SectionGetFlags "${SEC01}" $0
StrCmp $0 1 Enable
SectionGetFlags "${SEC02}" $0
StrCmp $0 1 Enable

GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 0
Goto End

Enable:
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 1

End:
FunctionEnd

Hope this helps.
-Jnuw

Hi Jnuw,

Thank you so much this is just what I need and now i understand further how does this work.

Next thing still the same but I am using different method.

The problem is here

section AA SEC0000
section end

section bb SEC0001
section end

Now I will like to see if there's other way to script it in such a way where if SEC0000 is selected, the install button will highlight and SEC0001 will be deselected.

if SEC0001 is selected, the install button will highlight and SEC0000 will be deselected.


Check out .\NSIS\Examples\one-section.nsi within your NSIS folder.

It should show you how to do what you want.

-jnuw


yes i currently using that. just to check out is there other ways only