install4j 根据变量隐藏安装组件

install4j hide installation component based on variable

我想要的是: 1 个安装程序有两种可能的情况:

我可以将它们设置在一个 varfile 中,但仍然允许使用 see 和 select。我怎样才能拥有可变控制组件的可见性和安装?

谢谢

这就是 "Installation type" 屏幕的用途:

如果你想让用户能够在"Installation components"画面中自定义画面之后的组件,并且隐藏一些组件,你得在"Installation type" 执行以下操作的屏幕:

boolean hidden = "lite".equals(context.getVariable("sys.installationTypeId"));
context.getInstallationComponentById("123").setHidden(hidden);

假设您已将自定义 ID "lite" 分配给精简版安装类型,并且应隐藏的安装组件的 ID 为“123”。