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}"