Debian Codegraph @

Examples/one-section.nsi

raw
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 ;--------------------------------
7
8 ; Section define/macro header file
9 ; See this header file for more info
10
11 !include "Sections.nsh"
12
13 ;--------------------------------
14
15 Name "One Section"
16 OutFile "one-section.exe"
17 RequestExecutionLevel user
18
19 ;--------------------------------
20
21 ; Pages
22
23 Page Components
24 Page InstFiles
25
26 ;--------------------------------
27
28 ; Sections
29
30 Section !Required
31 SectionIn RO
32 SectionEnd
33
34 Section "Group 1 - Option 1" g1o1
35 SectionEnd
36
37 Section /o "Group 1 - Option 2" g1o2
38 SectionEnd
39
40 Section /o "Group 1 - Option 3" g1o3
41 SectionEnd
42
43 Section "Group 2 - Option 1" g2o1
44 SectionEnd
45
46 Section /o "Group 2 - Option 2" g2o2
47 SectionEnd
48
49 Section /o "Group 2 - Option 3" g2o3
50 SectionEnd
51
52 ;--------------------------------
53
54 ; Functions
55
56 ; $1 stores the status of group 1
57 ; $2 stores the status of group 2
58
59 Function .onInit
60
61 StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default
62 StrCpy $2 ${g2o1} ; Group 2 - Option 1 is selected by default
63
64 FunctionEnd
65
66 Function .onSelChange
67
68 !insertmacro StartRadioButtons $1
69 !insertmacro RadioButton ${g1o1}
70 !insertmacro RadioButton ${g1o2}
71 !insertmacro RadioButton ${g1o3}
72 !insertmacro EndRadioButtons
73
74 !insertmacro StartRadioButtons $2
75 !insertmacro RadioButton ${g2o1}
76 !insertmacro RadioButton ${g2o2}
77 !insertmacro RadioButton ${g2o3}
78 !insertmacro EndRadioButtons
79
80 FunctionEnd