I'm new to NSIS as a concept but I couldn't find any information regarding why this is happening. This doesn't seem like expected behavior, especially since it's affecting a known-good NSI script[1].
For some reason, when using makensis 2.50-1 on Ubuntu 16.04, only the first section is processed. Consider the following script:
The output is two message boxes showing that sec1_id and sec2_id have the flags set to 0. A message box pops up with the message "-pre" and equally prints it to the log. Sections test1 and test2 never appear to have their code executed, as their respective message boxes and log messages do not appear. Intuitively, reading through the documentation, one can glean that perhaps the problem is that the sections aren't selected. Consider the next script, where the sections are marked as selected:Section -pre
DetailPrint "-pre"
MessageBox MB_OK "-pre"
SectionEnd
Section test1 sec1_id
DetailPrint "test1"
MessageBox MB_OK "test1"
SectionEnd
Section test2 sec2_id
DetailPrint "test2"
MessageBox MB_OK "test2"
SectionEnd
Function .onInit
SectionGetFlags ${sec1_id} $0
MessageBox MB_OK "sec1_id flags:$\n$0"
SectionGetFlags ${sec2_id} $0
MessageBox MB_OK "sec2_id flags:$\n$0"
FunctionEnd
I expect the output to be something like this:!include Sections.nsh
Section -pre
DetailPrint "-pre"
MessageBox MB_OK "-pre"
SectionEnd
Section test1 sec1_id
DetailPrint "test1"
MessageBox MB_OK "test1"
SectionEnd
Section test2 sec2_id
DetailPrint "test2"
MessageBox MB_OK "test2"
SectionEnd
Function .onInit
SectionGetFlags ${sec1_id} $0
MessageBox MB_OK "sec1_id flags:$\n$0"
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${sec1_id} $0
SectionGetFlags ${sec2_id} $0
MessageBox MB_OK "sec2_id flags:$\n$0"
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${sec2_id} $0
FunctionEnd
Or:-pre
test1
test2
Instead, this produces strange behavior. Message boxes for the flags of the two sections show up just fine, but strangely, three message boxes with the message -pre pop up, and -pre is printed three times to the log. The message boxes and log messages for test1 and test2 do not appear.-pre
test1
-pre
test2
Here's a screenshot to make it a little more clear what the output is:

What am I doing wrong? From reading through everything, the expected behavior should be a message box with "-pre", followed by a message box with "test1" and a message box with "test2," not three message boxes with the text "-pre" in it! Alternatively, I can see how -pre might prefix the message boxes for test1 and test2 as well, though test1 and test2 should execute, but they're not.
Is there a crucial detail I'm missing as to why the other sections aren't being processed properly? Thanks in advance for the help!
[1] The NSI script where I first started having this strange section issue was the OpenVPN NSI script: https://github.com/OpenVPN/openvpn-b...is/openvpn.nsi. None of the defined sections show up in the built installer!
