I'm having another problem with the predefined selections. The section size is changing depending on which section is selected. That works well as soon as the user actively clicked on a section. However if the section comes preselected due to insertmacro SelectSection it is not enforced.
Function .onInit
StrCpy $1 ""
ReadRegStr $1 HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}"
"SECTION_1"
StrCmp $1 "1" 0 Continue11
;MessageBox MB_OK "$1 -SelectSection ${sec1}"
!insertmacro SelectSection ${sec1}
Goto Continue111
Continue11:
Continue111:
StrCpy $2 ""
ReadRegStr $2 HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}"
"SECTION_2"
StrCmp $2 "1" 0 Continue12
!insertmacro SelectSection ${sec2}
Goto Continue121
Continue12:
Continue121:
.....
..... and some more sections
Call .onSelChange
${If} ${SectionIsSelected} ${sec2}
SectionSetSize ${sec4} 10
${Else}
SectionSetSize ${sec4} 10000
${EndIf}
${If} ${SectionIsSelected} ${sec3}
SectionSetSize ${sec5} 10
${Else}
SectionSetSize ${sec5} 10000
${EndIf}
${If} ${SectionIsSelected} ${sec4}
${AndIf} ${SectionIsSelected} ${sec2}
SectionSetSize ${sec4} 10
${EndIf}
..... some more conditions
So before I actively change section 1-3 (only one can be selected or none which works) - the SectionSetSize will not work correctly or at all.
In effect the idea is if section 2 is selected - then sec4 is size 10 (because it's the same files mainly getting installed. If not then it is 10000. If sec3 is selected - then sec5 size is 10, if not then 10000
But this code only works after actually selecting one of sec1 to sec3. Not with the preselection via !insertmacro SelectSection