Skip to content
⌘ NSIS Forum Archive

CustomPage depending on section selection

12 posts

Mosestycoon#

CustomPage depending on section selection

I am looking for a solution to show a custompage only when a specific section is checked at MUI_COMPONENTSPAGE.

I know there was a thread a few days agon but I can't find it anymore. By the way the solution there was not that understandable for me 😉

Could somebody re-explain?

Thx
Chris
deguix#
I found the post, and I put the code here!

!define SF_SELECTED 1
Page custom CustomPageName
Function CustomPageName
  SectionGetFlags $0 ${SectionDefineName}
  StrCmp $0 ${SF_SELECTED} 0 skipPage
    # show page here ...
    # InstallOptions::dialog....
  skipPage:
FunctionEnd 
deguix#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Mosestycoon#
By the way,

integration of deguix-solution forces the following compiler output:
Function: "SetCustomA"
!define: "SF_SELECTED"="1"
Usage: SectionGetFlags section_index $(user_var: output flags)
Error in script "C:\NSIS\TSW\tsw.nsi" on line 1152 -- aborting creation process 
with that function:
Function SetCustomA
  ;; TEST
  !define SF_SELECTED 1
  SectionGetFlags $0 ${secMySQL4}
  StrCmp $0 ${SF_SELECTED} 0 skipPage
  ;;
  
  !insertmacro MUI_HEADER_TEXT "$(PAGE_TITLE_MYSQL)" "$(PAGE_SUBTITLE_MYSQL)"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
 
  ;; TEST
  skipPage:
  
FunctionEnd 
deguix#
Kichik said this (that I understand):

!define SF_SELECTED 1
Page custom CustomPageName
Function CustomPageName
  SectionGetFlags $0 ${SectionDefineName}
  IntOp $0 $0 & ${SF_SELECTED}
  StrCmp $0 ${SF_SELECTED} 0 skipPage
    # show page here ...
    # InstallOptions::dialog....
  skipPage:
FunctionEnd 
virtlink#
I'm sorry KiCHiK. I don't question your NSIS knowledge. Not at all...
But I think that you mean this:
IntOp $0 $0 | ${SF_SELECTED}
According to this thread, I think.
kichik#
deguix you've got it backwards again... It's SectionGetFlags ${SectionDefineName} $0.

!include "Sections.nsh"

Page custom CustomPageName

Function CustomPageName
SectionGetFlags ${SectionDefineName} $0
IntOp $0 $0 & ${SF_SELECTED}
StrCmp $0 ${SF_SELECTED} 0 skipPage
# show page here ...
# InstallOptions::dialog....
skipPage:
FunctionEnd