one-section.nsi 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ; one-section.nsi
  2. ;
  3. ; This example demonstrates how to control section selection.
  4. ; It allows only one of the sections of a group to be selected.
  5. ;--------------------------------
  6. ; Section define/macro header file
  7. ; See this header file for more info
  8. !include "Sections.nsh"
  9. ;--------------------------------
  10. Name "One Section"
  11. OutFile "one-section.exe"
  12. RequestExecutionLevel user
  13. ;--------------------------------
  14. ; Pages
  15. Page components
  16. ;--------------------------------
  17. ; Sections
  18. Section !Required
  19. SectionIn RO
  20. SectionEnd
  21. Section "Group 1 - Option 1" g1o1
  22. SectionEnd
  23. Section /o "Group 1 - Option 2" g1o2
  24. SectionEnd
  25. Section /o "Group 1 - Option 3" g1o3
  26. SectionEnd
  27. Section "Group 2 - Option 1" g2o1
  28. SectionEnd
  29. Section /o "Group 2 - Option 2" g2o2
  30. SectionEnd
  31. Section /o "Group 2 - Option 3" g2o3
  32. SectionEnd
  33. ;--------------------------------
  34. ; Functions
  35. ; $1 stores the status of group 1
  36. ; $2 stores the status of group 2
  37. Function .onInit
  38. StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default
  39. StrCpy $2 ${g2o1} ; Group 2 - Option 1 is selected by default
  40. FunctionEnd
  41. Function .onSelChange
  42. !insertmacro StartRadioButtons $1
  43. !insertmacro RadioButton ${g1o1}
  44. !insertmacro RadioButton ${g1o2}
  45. !insertmacro RadioButton ${g1o3}
  46. !insertmacro EndRadioButtons
  47. !insertmacro StartRadioButtons $2
  48. !insertmacro RadioButton ${g2o1}
  49. !insertmacro RadioButton ${g2o2}
  50. !insertmacro RadioButton ${g2o3}
  51. !insertmacro EndRadioButtons
  52. FunctionEnd