如何使用 NSIS 实现风味(最小、标准、完整)和复选框选项?

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

我正在为 NSIS(Nullsoft 脚本安装系统)的 Section 配置而苦苦挣扎。

我想实现如下模型所示的安装选项:

下拉列表包含以下元素:

"MyApp Core Components" 是必需的组件,我已经实现了它,因为只有一个部分是必需的选项。

但是,如何设置其他部分(功能 A/B/C 和子部分)?如何在父部分停用时自动取消选择子部分(可能不止一个)? 一般如何缩进一个部分(如屏幕截图所示)? 以及如何使用自动选择(覆盖)实现下拉列表,另一方面,当用户手动更改功能时,将下拉列表更改为 "Custom"?

要创建树形布局,您需要使用 SectionGroup。使用 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