We are working on converting the wiki to a static website controlled by markdown files in https://github.com/nsis-community. You can already see there how plug-ins will be posted. The end-user interface will still be a website but with a fresh coat of paint. Come meet us at Discord to talk about it.

Show custom page when a section has been selected

From NSIS Wiki
Jump to navigationJump to search
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