From 7d5b7223e69a9401c7d05821ad05eebfd347e627 Mon Sep 17 00:00:00 2001 From: joostverburg Date: Wed, 7 May 2003 11:34:27 +0000 Subject: [PATCH] SetSectionInInstType / ClearSectionInInstType git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2534 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/Sections.nsh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Include/Sections.nsh b/Include/Sections.nsh index 858973a8..af101daa 100644 --- a/Include/Sections.nsh +++ b/Include/Sections.nsh @@ -42,4 +42,36 @@ Pop $0 !macroend +; For details about SetSectionInInstType and ClearSectionInInstType, see +; http://nsis.sourceforge.net/archive/nsisweb.php?page=287 + +!define INSTTYPE_1 1 +!define INSTTYPE_2 2 +!define INSTTYPE_3 4 +!define INSTTYPE_4 8 +!define INSTTYPE_5 16 +!define INSTTYPE_6 32 +!define INSTTYPE_7 64 +!define INSTTYPE_8 128 + +!macro SetSectionInInstType SECTION_NAME WANTED_INSTTYPE + Push $0 + SectionGetInstTypes "${SECTION_NAME}" $0 + IntOp $0 $0 | ${WANTED_INSTTYPE} + SectionSetInstTypes "${SECTION_NAME}" $0 + Pop $0 +!macroend + +!macro ClearSectionInInstType SECTION_NAME WANTED_INSTTYPE + Push $0 + Push $1 + SectionGetInstTypes "${SECTION_NAME}" $0 + StrCpy $1 ${WANTED_INSTTYPE} + IntOp $1 $1 ~ + IntOp $0 $0 & $1 + SectionSetInstTypes "${SECTION_NAME}" $0 + Pop $1 + Pop $0 +!macroend + !endif \ No newline at end of file