Archive: Macro selection question


Macro selection question
Hi,

since I am new to NSIS excuse the (probably) beginner level question.
The eclipse wizard generated me an NSIS script with the code below. I understood some of it however have trouble understanding the code below (thus have problems adapting it):

Here is what i think:
1. It reads the name of the section from the registry
2. It selects the proper uninstall section?

-> Now i removed all registry writing (don't need it) thus how do I have to adapt the code? (e.g. Didn't find what next$ or done$ meant...)

#ORIGINAL:
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend


#MY APPROACH, surely wrong/optimizable:
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID

GoTo next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:

!macroend


Can anyone tell me how i can adapt this part correctly?
Thanks,
TeeWeTee


next$ doesn't mean anything, but "next${UNSECTION_ID}:" becomes "next1:" after the precompiler, which is simply a label (a goto-jump point).

If you dont want automatic section selection from the registry, just don't use the select_unsection macro at all, I guess?