Components Page Next Button

From NSIS Wiki
Jump to navigationJump to search
Author: Takhir (talk, contrib)


Description

Enabled 'Next' button looks confusing if none of sections selected. Function disables Next button on the components page for this situation. Simple components structure in this sample (no groups), 4 sections - use your own section names in function instead og gXX. Another way is to make one section read only and checked.

The Script

Section $(binaries) g01
 
SectionEnd
 
...
 
Function .onSelChange
 
  Push $0
  Push $1
  SectionGetFlags ${g01} $0
  IntOp $0 ${SF_SELECTED} & $0
  SectionGetFlags ${g02} $1
  IntOp $1 ${SF_SELECTED} & $1
  IntOp $0 $1 | $0
  SectionGetFlags ${g03} $1
  IntOp $1 ${SF_SELECTED} & $1
  IntOp $0 $1 | $0
  SectionGetFlags ${g04} $1
  IntOp $1 ${SF_SELECTED} & $1
  IntOp $0 $1 | $0
  GetDlgItem $1 $HWNDPARENT 1
  EnableWindow $1 $0
  Pop $1
  Pop $0
 
FunctionEnd