one-section.nsi 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. Page InstFiles
  17. ;--------------------------------
  18. ; Sections
  19. Section !Required
  20. SectionIn RO
  21. SectionEnd
  22. Section "Group 1 - Option 1" g1o1
  23. SectionEnd
  24. Section /o "Group 1 - Option 2" g1o2
  25. SectionEnd
  26. Section /o "Group 1 - Option 3" g1o3
  27. SectionEnd
  28. Section "Group 2 - Option 1" g2o1
  29. SectionEnd
  30. Section /o "Group 2 - Option 2" g2o2
  31. SectionEnd
  32. Section /o "Group 2 - Option 3" g2o3
  33. SectionEnd
  34. ;--------------------------------
  35. ; Functions
  36. ; $1 stores the status of group 1
  37. ; $2 stores the status of group 2
  38. Function .onInit
  39. StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default
  40. StrCpy $2 ${g2o1} ; Group 2 - Option 1 is selected by default
  41. FunctionEnd
  42. Function .onSelChange
  43. !insertmacro StartRadioButtons $1
  44. !insertmacro RadioButton ${g1o1}
  45. !insertmacro RadioButton ${g1o2}
  46. !insertmacro RadioButton ${g1o3}
  47. !insertmacro EndRadioButtons
  48. !insertmacro StartRadioButtons $2
  49. !insertmacro RadioButton ${g2o1}
  50. !insertmacro RadioButton ${g2o2}
  51. !insertmacro RadioButton ${g2o3}
  52. !insertmacro EndRadioButtons
  53. FunctionEnd