remember previously selected sections

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4990 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-03-10 14:41:05 +00:00
parent f6849b6bec
commit 2969aa40fc
5 changed files with 666 additions and 49 deletions

77
Examples/Memento.nsi Normal file
View file

@ -0,0 +1,77 @@
!include LogicLib.nsh
!include Memento.nsh
Name Memento
OutFile Memento.exe
XPStyle on
ShowInstDetails show
Page components
Page instfiles
# settings
!define MEMENTO_REGISTRY_ROOT HKLM
!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 HKLM "Software\NSIS\Memento Test"
WriteRegStr HKLM "Software\NSIS\Memento Test" MementoSectionUsed ""
WriteRegDWORD HKLM "Software\NSIS\Memento Test" MementoSection_sec_horse 1
WriteRegDWORD HKLM "Software\NSIS\Memento Test" MementoSection_sec_chicken 1
WriteRegDWORD HKLM "Software\NSIS\Memento Test" MementoSection_sec_donkey 0
WriteRegDWORD HKLM "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