Show custom page when a section has been selected

From NSIS Wiki

Author: jan (talk, contrib)


Description

If you want to show a custom page only when a certain section has been selected, use SectionGetFlags to get the state of the section in the page creator function and the abort command to skip the page if the section has not been selected.


The Script

!include "Sections.nsh"
 
Page custom CustomPage
 
Function CustomPage
 
  SectionGetFlags ${Section_Name} $R0 
  IntOp $R0 $R0 & ${SF_SELECTED} 
  IntCmp $R0 ${SF_SELECTED} show 
 
  Abort 
 
  show: 
 
  ;If not using Modern UI use InstallOptions::dialog "iofile.ini"
  !insertmacro MUI_HEADER_TEXT "text" "subtext" 
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "iofile.ini" 
 
FunctionEnd
Personal tools
donate
ads