Archive: StrCmp: relative jumps VS labels


StrCmp: relative jumps VS labels
I would like to disable uninstaller sections depending on if
the corresponding section had been selected on install.

Why does the following work:


Function un.onInit
Push $0
ReadINIStr $0 "$INSTDIR\${CONFIG_FILE}" "SectionName" "Sec01"
StrCmp $0 "" no yes
no:
!insertmacro UnselectSection ${unSec01}
yes:
FunctionEnd


Whereas the following disselects the section in any case:

Function un.onInit
Push $0
ReadINIStr $0 "$INSTDIR\${CONFIG_FILE}" "SectionName" "Sec01"
StrCmp $0 "" +1 +2
!insertmacro UnselectSection ${unSec01}
FunctionEnd


Remember that a relative jump jumps over a certain number of commands.

You are inserting a macro that includes multiple commands. Using a label is recommended.


Thanks for the quick help :-)


Also take a look at section 4.4 of the documentation.