简体   繁体   English

如何在NSIS中实现风味(最小,标准,完整)和复选框选项?

[英]How to implement Flavours (minimal, standard, complete) and Checkbox Options with NSIS?

I am struggling with the Section configuration of NSIS (Nullsoft Scriptable Install System). 我在NSIS (Nullsoft可编写脚本的安装系统)的Section配置方面苦苦挣扎。

I want to implement installation options as shown in the following mockup: 我想要实现安装选项,如以下模型所示:

安装风味筛

The drop down list contains the following elements: 下拉列表包含以下元素:

  • Minimal (only MyApp Core Components is selected), 最小(仅选择MyApp核心组件),
  • Standard (MyApp Core Components, Feature A/B/C, and the Feature's Required Components are selected), 标准(选择了MyApp核心组件,功能A / B / C和功能的必需组件),
  • Complete (everything is selected), and 完成(所有内容均已选中),并且
  • Custom (not selectable but shown when modifying the atomic options). 自定义(不可选择,但在修改原子选项时显示)。

"MyApp Core Components" is the required component, and I already have that implemented as there is a required option for only one section. “ MyApp核心组件”是必需的组件,由于只有一个部分具有必需的选项,因此我已经实现了该组件。

However, how do I set-up the other section (Feature A/B/C, and sub-sections)? 但是,如何设置其他部分(功能A / B / C和子部分)? How to automatically deselect the sub-sections (there may more than one) when the parent section becomes deactivated? 当父节被停用时,如何自动取消选择子节(可能有多个)? How to indent a section in general (like in the screenshot)? 一般如何缩进某个部分(如屏幕截图所示)? And how to implement the drop down list with the automatic selection (override), and on the other side, change the drop down to "Custom" when the user changes features manually? 以及如何通过自动选择(覆盖)实现下拉列表,另一方面,当用户手动更改功能时,如何将下拉列表更改为“自定义”?

To create a tree layout you need to use SectionGroup . 要创建树形布局,您需要使用SectionGroup Use SectionIn to tie a Section to a specific InstType : 使用SectionInSection绑定到特定的InstType

Page Components
Page InstFiles

InstType "Full"
!define IT_FULL 1
InstType "Minimal"
!define IT_MINIMAL 2


Section "Required stuff"
    SectionIn RO
SectionEnd

SectionGroup /e "G1"
    Section "G1:A"
        SectionIn ${IT_FULL} ${IT_MINIMAL}
    SectionEnd
    Section "G1:B"
        SectionIn ${IT_FULL}
    SectionEnd
SectionGroupEnd

Section "a section"
    SectionIn ${IT_FULL} ${IT_MINIMAL}
SectionEnd

Section "another section"
    SectionIn ${IT_FULL}
SectionEnd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM