I've got a problem. I've have templates to install. Only one template should be selectable at once (problem solved). The other thing is that the installer should check which Language the system has and preselect the correct template for the user. I've startet with the following code:
What am I doing wrong? THe Buttons are RadioButtons but whatever language I have nothing is preselected. Any ideas? Thanks.
var PreSelect
[... in the .oninit function ...]
StrCmp $LANGUAGE ${LANG_FRENCH} 0 +3
StrCpy $PreSelLang ${template_french}
goto PreSelectEnd
StrCmp $LANGUAGE ${LANG_GERMAN} 0 +3
StrCpy $PreSelLang ${template_german}
goto PreSelectEnd
StrCmp $LANGUAGE ${LANG_ITALIAN} 0 +3
StrCpy $PreSelLang ${template_italian}
goto PreSelectEnd
StrCmp $LANGUAGE ${LANG_SPANISH} 0 PreSelectEnd
StrCpy $PreSelLang ${template_spanish}
goto PreSelectEnd
StrCpy $PreSelLang ${template_english}
goto PreSelectEnd
PreSelectEnd:
[... the sections ...]
SectionGroup "Template language" templates
Section /o "English" templates_english
[stuff]
SectionEnd
Section /o "German" templates_german
[stuff]
SectionEnd
Section /o "French" templates_french
[stuff]
SectionEnd
Section /o "Italian" templates_italian
[stuff]
SectionEnd
Section /o "Spanish" templates_spanish
[stuff]
SectionEnd
SectionGroupEnd
.... and ...
Function .onSelChange
# EN, DE, IT, ES, FR
!insertmacro StartRadioButtons $PreSelLang
!insertmacro RadioButton ${templates_english}
!insertmacro RadioButton ${templates_french}
!insertmacro RadioButton ${templates_german}
!insertmacro RadioButton ${templates_italian}
!insertmacro RadioButton ${templates_spanish}
!insertmacro EndRadioButtons
FunctionEnd