Archive: Disable Next button


Disable Next button
Hi,

I wanted to disable Next button in Components page if none of the components have been selected. Following is the code I written under "MUI_PAGE_CUSTOMFUNCTION_LEAVE AfterComponentsSelect".

Function AfterComponentsSelect

SectionGetFlags ${smd_components} $R0
SectionGetFlags ${xlt_components} $R1

${If} $R0 == 0x00000000
${AndIf} $R1 == 0x00000000
GetDlgItem $0 $HWNDPARENT 1 ; next=1, cancel=2, back=3
EnableWindow $0 0
${EndIf}

FunctionEnd

Initially the first component is selected in default. But when I uncheck it Next button wont disable. Still I can proceed the installation. Can someone give me an idea to disable Next button in this case...


Leave functions are called after the next button is pressed, so it's no use disabling the button there. Either use abort in the leave function, or disable the button in .onSelChange.

http://nsis.sourceforge.net/Docs/Cha...html#4.7.2.1.8


It worked when I call it in .OnSelChange as follows.


Function .onSelChange

SectionGetFlags ${smd_components} $R0
SectionGetFlags ${xlt_components} $R1

${If} $R0 == 0
${AndIf} $R1 == 0
GetDlgItem $0 $HWNDPARENT 1 ; next=1, cancel=2, back=3
EnableWindow $0 0
${Else}
GetDlgItem $0 $HWNDPARENT 1 ; next=1, cancel=2, back=3
EnableWindow $0 1
${EndIf}

FunctionEnd

Thanks for ur reply...