root / tmp / org.txm.setups / nsis / Examples / Memento.nsi @ 3140
Historique | Voir | Annoter | Télécharger (1,5 ko)
1 |
!include LogicLib.nsh |
---|---|
2 |
!include Memento.nsh |
3 |
|
4 |
Name Memento |
5 |
OutFile Memento.exe |
6 |
|
7 |
XPStyle on |
8 |
|
9 |
ShowInstDetails show |
10 |
|
11 |
Page components |
12 |
Page instfiles |
13 |
|
14 |
RequestExecutionLevel user |
15 |
|
16 |
# settings |
17 |
|
18 |
!define MEMENTO_REGISTRY_ROOT HKCU |
19 |
!define MEMENTO_REGISTRY_KEY "Software\NSIS\Memento Test" |
20 |
|
21 |
# restore |
22 |
|
23 |
Function .onInit |
24 |
|
25 |
${If} ${Cmd} `MessageBox MB_YESNO "Would you like to load an example state?" IDYES` |
26 |
|
27 |
DeleteRegKey HKCU "Software\NSIS\Memento Test" |
28 |
|
29 |
WriteRegStr HKCU "Software\NSIS\Memento Test" MementoSectionUsed "" |
30 |
WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_horse 1 |
31 |
WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_chicken 1 |
32 |
WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_donkey 0 |
33 |
WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_croc 0 |
34 |
|
35 |
${EndIf} |
36 |
|
37 |
${MementoSectionRestore} |
38 |
|
39 |
FunctionEnd |
40 |
|
41 |
# sections |
42 |
|
43 |
${MementoSection} horse sec_horse |
44 |
${MementoSectionEnd} |
45 |
|
46 |
${MementoSection} donkey sec_donkey |
47 |
${MementoSectionEnd} |
48 |
|
49 |
${MementoSection} chicken sec_chicken |
50 |
${MementoSectionEnd} |
51 |
|
52 |
SectionGroup /e group |
53 |
|
54 |
SectionGroup /e group |
55 |
|
56 |
${MementoSection} croc sec_croc |
57 |
${MementoSectionEnd} |
58 |
|
59 |
${MementoSection} cow sec_cow |
60 |
${MementoSectionEnd} |
61 |
|
62 |
SectionGroupEnd |
63 |
|
64 |
SectionGroupEnd |
65 |
|
66 |
${MementoUnselectedSection} dinosaur sec_dinosaur |
67 |
${MementoSectionEnd} |
68 |
|
69 |
# done... |
70 |
|
71 |
${MementoSectionDone} |
72 |
|
73 |
# save |
74 |
|
75 |
Function .onInstSuccess |
76 |
|
77 |
${MementoSectionSave} |
78 |
|
79 |
FunctionEnd |