Inno Setup自定义安装中的预检查或未检查的组件

问题描述

我只需要1个具有3个组件的自定义安装类型:

  • 一个是必需的,因此已选中且为只读。
  • 第二个是可选的,但是认设置的一部分,因此已选中且可写。
  • 第三个只是可选的,因此未经检查且可写。

如果我未明确指定类型,则认情况下我不会设法检查组件。

如果指定一个,则认情况下不会取消选中最后一个组件。

我尝试了2种类型,但是它没有意义,因为它只是一个自定义安装。 知道如何通过单一类型获得预期的行为吗?

[Types]
Name: "standard"; Description: "Standard installation";
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "first"; Description: "First Component"; Types: standard custom; Flags: fixed 
Name: "second"; Description: "Second Component"; Types: standard custom; 
Name: "third"; Description: "Third Component"; Types: custom;

解决方法

这应该做:

[Types]
Name: "custom"; Description: "Dummy custom installation"; Flags: iscustom

[Components]
Name: "first"; Description: "First Fixed Component"; Types: custom; Flags: fixed 
Name: "second"; Description: "Second Checked Component"; Types: custom 
Name: "third"; Description: "Third Unchecked Component"

enter image description here