Memento.nsi 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. !include LogicLib.nsh
  2. !include Memento.nsh
  3. Name Memento
  4. OutFile Memento.exe
  5. XPStyle on
  6. ShowInstDetails show
  7. Page components
  8. Page instfiles
  9. RequestExecutionLevel user
  10. # settings
  11. !define MEMENTO_REGISTRY_ROOT HKCU
  12. !define MEMENTO_REGISTRY_KEY "Software\NSIS\Memento Test"
  13. # restore
  14. Function .onInit
  15. ${If} ${Cmd} `MessageBox MB_YESNO "Would you like to load an example state?" IDYES`
  16. DeleteRegKey HKCU "Software\NSIS\Memento Test"
  17. WriteRegStr HKCU "Software\NSIS\Memento Test" MementoSectionUsed ""
  18. WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_horse 1
  19. WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_chicken 1
  20. WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_donkey 0
  21. WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_croc 0
  22. ${EndIf}
  23. ${MementoSectionRestore}
  24. FunctionEnd
  25. # sections
  26. ${MementoSection} horse sec_horse
  27. ${MementoSectionEnd}
  28. ${MementoSection} donkey sec_donkey
  29. ${MementoSectionEnd}
  30. ${MementoSection} chicken sec_chicken
  31. ${MementoSectionEnd}
  32. SectionGroup /e group
  33. SectionGroup /e group
  34. ${MementoSection} croc sec_croc
  35. ${MementoSectionEnd}
  36. ${MementoSection} cow sec_cow
  37. ${MementoSectionEnd}
  38. SectionGroupEnd
  39. SectionGroupEnd
  40. ${MementoUnselectedSection} dinosaur sec_dinosaur
  41. ${MementoSectionEnd}
  42. # done...
  43. ${MementoSectionDone}
  44. # save
  45. Function .onInstSuccess
  46. ${MementoSectionSave}
  47. FunctionEnd