From a453e3281ea76c54b94478a5b1363ee372bb20e2 Mon Sep 17 00:00:00 2001 From: eccles Date: Sun, 14 Dec 2003 00:19:48 +0000 Subject: [PATCH] NSIS Logic Library - dselkirk's selectlib 1.1: - Added simplified macros and removed NAME requirement git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3273 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/LogicLib.nsi | 10 +++++----- Include/LogicLib.nsh | 10 ++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Examples/LogicLib.nsi b/Examples/LogicLib.nsi index 291e9e7c..95e8bcc0 100644 --- a/Examples/LogicLib.nsi +++ b/Examples/LogicLib.nsi @@ -5,12 +5,12 @@ silentinstall silent !include "selectlib.nsh" Section - !insertmacro SELECT "TESTCASE" "test1" - !insertmacro CASE "test1" + ${SELECT} "test1" + ${CASE} "test1" MessageBox MB_OK "case test1" - !insertmacro CASE "test 2;test3" + ${CASE} "test 2;test3" MessageBox MB_OK "case test2 or test3" - !insertmacro CASE_ELSE + ${CASE_ELSE} MessageBox MB_OK "case else" - !insertmacro SELECTEND + ${SELECTEND} SectionEnd \ No newline at end of file diff --git a/Include/LogicLib.nsh b/Include/LogicLib.nsh index c4b68044..c33262e3 100644 --- a/Include/LogicLib.nsh +++ b/Include/LogicLib.nsh @@ -19,12 +19,18 @@ ; ; History: ; 1.0 - 09/19/2003 - Initial release +; 1.1 - 09/20/2003 - Added simplified macros and removed NAME requirement !ifndef SELECTLIB !define SELECTLIB -!macro SELECT NAME VALUE - !define SELECT_NAME "${NAME}" +!define SELECT "!insertmacro SELECT" +!define CASE "!insertmacro CASE" +!define CASE_ELSE "!insertmacro CASE_ELSE" +!define SELECTEND "!insertmacro SELECTEND" + +!macro SELECT VALUE + !define SELECT_NAME "${__LINE__}" !define SELECT_VALUE "${VALUE}" !define SELECT_COUNT "${__LINE__}" Goto "lbl_${SELECT_NAME}_${SELECT_COUNT}"