Statistiques
| Révision :

root / tmp / org.txm.setups / nsis-2.5 / Examples / one-section.nsi @ 3030

Historique | Voir | Annoter | Télécharger (1,54 ko)

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