File: Memento.nsi

package info (click to toggle)
nsis 2.51-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,368 kB
  • ctags: 9,644
  • sloc: cpp: 32,346; ansic: 29,335; python: 1,148; asm: 532; xml: 487; pascal: 179; makefile: 178
file content (79 lines) | stat: -rwxr-xr-x 1,532 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
!include LogicLib.nsh
!include Memento.nsh

Name Memento
OutFile Memento.exe

XPStyle on

ShowInstDetails show

Page components
Page instfiles

RequestExecutionLevel user

# settings

!define MEMENTO_REGISTRY_ROOT HKCU
!define MEMENTO_REGISTRY_KEY "Software\NSIS\Memento Test"

# restore

Function .onInit

  ${If} ${Cmd} `MessageBox MB_YESNO "Would you like to load an example state?" IDYES`
    
	DeleteRegKey  HKCU "Software\NSIS\Memento Test"

	WriteRegStr   HKCU "Software\NSIS\Memento Test" MementoSectionUsed ""
	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_horse   1
	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_chicken 1
	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_donkey  0
	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_croc    0

  ${EndIf}

  ${MementoSectionRestore}

FunctionEnd

# sections

${MementoSection} horse sec_horse
${MementoSectionEnd}

${MementoSection} donkey sec_donkey
${MementoSectionEnd}

${MementoSection} chicken sec_chicken
${MementoSectionEnd}

SectionGroup /e group

  SectionGroup /e group

    ${MementoSection} croc sec_croc
    ${MementoSectionEnd}

    ${MementoSection} cow sec_cow
    ${MementoSectionEnd}

  SectionGroupEnd

SectionGroupEnd

${MementoUnselectedSection} dinosaur sec_dinosaur
${MementoSectionEnd}

# done...

${MementoSectionDone}

# save

Function .onInstSuccess

  ${MementoSectionSave}

FunctionEnd