Archive: Next Button is Visible when No Section is Selected


Next Button is Visible when No Section is Selected
Hello everyone,

I have Created a new Installer Package of My project, I have added two sections in that ,
1. Installer & 2. Uninstaller.

I want to Disable the Next Button while no option is selected in that sections.

When one of the option is select "Next" button is enable, pls suggest me.

Thanks
lmenaria


Use the .onSelChange function to check when Sections are checked:

!include Sections.nsh

Section "A section" Sec1
SectionEnd

Section "Another section" Sec2
SectionEnd

Function .onSelChange

SectionGetFlags ${Sec1} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} +4

SectionGetFlags ${Sec2} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 +4

GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 1

Goto +3

GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0

FunctionEnd


-Stu

Or with the LogicLib:

!include LogicLib.nsh

Function .onSelChange

GetDlgItem $0 $HWNDPARENT 1

${If} ${SectionIsSelected} ${Sec1}
${OrIf} ${SectionIsSelected} ${Sec2}

EnableWindow $0 1

${Else}

EnableWindow $0 0

${EndIf}

FunctionEnd