Skip to content
⌘ NSIS Forum Archive

Setting checkbox selected

3 posts

kalverson#

Setting checkbox selected

I am trying to set a checkbox selected in a custom page using a pre call. The only checkbox that is selected is the one I used SelectIn on which I alway want on. The function works fine for setting the install type, but the SectionSetFlag is not working at all. What I am doing wrong?


Function ComponentsPre

SetCurInstType 0

; check if a previous custom install was done
; if yes, then set custom install type and enable checkboxes

ClearErrors
IfFileExists "$INSTDIR\c1.win.c1report.2.dll" yescro chkadm

yescro:
SetCurInstType 1
SectionSetFlags ${SEC11} ${SF_SELECTED}

chkadm:
ClearErrors
IfFileExists "$INSTDIR\SEQUEL_Admin.EXE" yesadm chkexcel

yesadm:
SetCurInstType 1

chkexcel:
ClearErrors
IfFileExists "$INSTDIR\SEQUEL.ExcelAddIn.Interface.tlb" 0 end1
SetCurInstType 1
SectionSetFlags ${SEC13} ${SF_SELECTED}

end1:

FunctionEnd
kalverson#
After some debug I found the issue. It is the SetCurInstType that clears the previously set section flag. I moved the checks around and the last one processed alway worked. Then I started commenting out things to see what might be clearing the flag and discovered it was SetCurInstType. I can code around this now that I know it does that. The documentation didn't say anything about it clearing an already set section flag.
Anders#
Clearly it has to set the section state, that is the only way it can apply a specific install type.