Nsis 是否从节中打开自定义页?

Nsis 是否从节中打开自定义页?,nsis,Nsis,我正在整理我的第一个NSIS安装程序脚本,遇到了一些问题 我使用的是现代UI,并在下面提供了一个简化脚本: !insertmacro MUI_PAGE_COMPONENTS Page custom CustomPage Section "Tomcat" SEC01 ;stuff in here to install Tomcat from bundled installer SectionEnd Section "Deploy WARS" SEC02 ;Fire a separa

我正在整理我的第一个NSIS安装程序脚本,遇到了一些问题

我使用的是现代UI,并在下面提供了一个简化脚本:

!insertmacro MUI_PAGE_COMPONENTS
Page custom CustomPage

Section "Tomcat" SEC01  
;stuff in here to install Tomcat from bundled installer  
SectionEnd

Section "Deploy WARS" SEC02  
;Fire a separate custom page so that I can use nsDialog to get
;user to choose a folder location for deploying WARs.
;(as potentially their could be more than one Tomcat installed) 
SectionEnd
从我所读到的内容来看,您无法从一个分区内启动自定义页面。
那么,我如何维护MUI\u页面\u组件页面,以允许用户选择是否安装Tomcat和/或同时部署WAR。


我需要一个自定义页面,对吗?

您可以有多个instfiles页面,这样您就可以有一个具有此页面顺序的安装程序:

  • 组成部分
  • InstFiles(安装Tomcat)
  • 目录(选择WAR目的地)
  • InstFiles(安装WAR)
  • 如果未选择War组件,则第3页和第4页的预回调函数需要使用sections.nsh中的SectionFlagIsSet,并调用
    Abort
    ,从而跳过页面



    另一种选择是尝试插件并在instfiles页面的子窗口中显示自定义对话框…

    ahh-ok。你有没有可能详细说明一下SectionFlagIsSet的位置?我应该在SECTOM部分和SECWAR部分之间调用SectionFlagIsSet,而不是在末尾?我对订单有点困惑我真的不明白你想要的逻辑,也许是什么?
    Section "Tomcat" SECTOM
    SectionEnd
    Section /o "WAR" SECWAR
    SectionEnd
    Section
    ;Use macros from sections.nsh to deselect SECTOM and select SECWAR
    SectionEnd