Advertisement
Anders

NSIS:LogicLib: RegIfKeyExists

Mar 5th, 2012
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !include LogicLib.nsh
  2.  
  3. !ifmacrondef _RegIfKeyExists
  4. !macro _RegIfKeyExists _a _b _t _f
  5. !insertmacro _LOGICLIB_TEMP
  6. ClearErrors
  7. EnumRegKey $_LOGICLIB_TEMP ${_a} "${_b}" 0
  8. IfErrors ${_f} ${_t}
  9. !macroend
  10. !define RegIfKeyExists 'RegIfKeyExists'
  11. !endif
  12.  
  13. Section
  14. ${If} HKCU ${RegIfKeyExists} "software\clients\test"
  15. MessageBox mb_ok exists
  16. ${Else}
  17. MessageBox mb_ok doesNOTexist
  18. ${EndIf}
  19. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement