Skip to content
⌘ NSIS Forum Archive

Bug: GetSectionFlags not working correctly

3 posts

dbach#

Bug: GetSectionFlags not working correctly

Hi NSIS-Developers,

maybe I've found a Bug. I had implemented the "Show custom page when a section has been selected" from Wiki Page (see also http://nsis.sourceforge.net/Show_cus..._been_selected ). But this won't work if you have hidden sections before the section you try to get the flags from.

This example will work:
Section "Name of Section" MIP
...
SectionEnd
Section "-HiddenSection"
...
Section End 
and this example doesn't work with the example of the wikipage

Section "-HiddenSection"
...
Section End
Section "Name of Section" MIP
...
SectionEnd 
In this case the Flag will always be "1" and I don't know why. I think this is a bug ... or am I doing something wrong?

Edit:
Here is my Custom Page ...
Page custom Settings
Function Settings
  SectionGetFlags ${MIP} $R0
  IntOp $R0 $R0 & ${SF_SELECTED}
  MessageBox MB_OK "R0: $R0"
  IntCmp $R0 ${SF_SELECTED} show
  Abort
  show:
  !insertmacro MUI_HEADER_TEXT "Settings" "Please select your Settings for the product"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "settings.ini"
  !insertmacro MUI_INSTALLOPTIONS_READ $hostname "settings.ini" "Field 1" "State"
  !insertmacro MUI_INSTALLOPTIONS_READ $hosttitle "settings.ini" "Field 2" "State"
  !insertmacro MUI_INSTALLOPTIONS_READ $tcpadress "settings.ini" "Field 3" "State"
  !insertmacro MUI_INSTALLOPTIONS_READ $port "settings.ini" "Field 4" "State"
  !insertmacro MUI_INSTALLOPTIONS_READ $title "settings.ini" "Field 5" "State"
FunctionEnd 
Thank you very much,
Denis Bach
Afrow UK#
Works fine for me. Make sure you reference ${MIP} after the actual section for that is where it becomes defined during the compile process.

Stu
dbach#edited
Hi Stu,

thanks for your reply. What do you mean by reference ${MIP} after the actual section? My custom page has to be defined after the section for installation?

Sorry, my english isn't the best. 😉

Edit:
I got it (testing). Thank you very much again! 🙂

Best regards,
Denis