Rob*_*ski 2 checkbox inno-setup hierarchy pascalscript
我正在尝试将一个子组件显示为兄弟组件。我正在为游戏制作一个安装程序,该游戏可以在同一安装文件夹中共存多个版本的游戏。
现在我希望能够安装可选的模组,这些模组需要安装特定版本的游戏(依赖项)。因此,当用户单击某个模组时,就会选择所需的游戏,如果取消选择该游戏,则所有模组都会被取消选择。代码按预期工作并且行为如前所述。有时它会让用户感到有点困惑。例如,如果没有安装 mod,则游戏中会显示一个正方形而不是检查,并且 mod 的层次结构是不必要的。
我想要实现的目标:
game_2显示支票而不是方块。game_2\com_mods兄弟姐妹game_2而不是孩子。据我所知,我想没有简单的方法可以达到这种效果。如果我没有错误地使用该[Code]部分,则可以修改 UI,但我不知道如何强制使用复选框而不是正方形并删除子项的填充。
这是我的示例代码:
[Setup]
AppName=Demo
AppVersion=1.0
DefaultDirName=.
[Components]
Name: "game_1"; Description: "Game v1"; Types: full custom; Flags: checkablealone
Name: "game_2"; Description: "Game v2"; Types: full custom; Flags: checkablealone
Name: "game_2\com_mods"; Description: "Game Community Mods"; Types: full custom; Flags: dontinheritcheck
Name: "game_2\com_mods\3rdmod1"; Description: "Mod 1"; Flags: exclusive
Name: "game_2\com_mods\3rdmod1"; Description: "Mod 2"; Flags: exclusive
Name: "game_2\com_mods\3rdmod1"; Description: "Mod 3"; Flags: exclusive
Run Code Online (Sandbox Code Playgroud)
我希望有人可以帮助我或为我指明正确的方向以产生预期的效果。
问候和感谢。
如果我正确理解你的问题,你想要这样的布局:
[Components]
Name: "game_1"; Description: "Game v1"; Types: full custom
Name: "game_2"; Description: "Game v2"; Types: full custom
Name: "com_mods"; Description: "Game Community Mods"; Types: full custom
Name: "com_mods\3rdmod1"; Description: "Mod 1"; Flags: exclusive
Name: "com_mods\3rdmod1"; Description: "Mod 2"; Flags: exclusive
Name: "com_mods\3rdmod1"; Description: "Mod 3"; Flags: exclusive
Run Code Online (Sandbox Code Playgroud)
但您想保留当前布局的行为。
然后您必须在 Pascal 脚本中编写行为代码:
[Components]
Name: "game_1"; Description: "Game v1"; Types: full custom
Name: "game_2"; Description: "Game v2"; Types: full custom
Name: "com_mods"; Description: "Game Community Mods"; Types: full custom
Name: "com_mods\3rdmod1"; Description: "Mod 1"; Flags: exclusive
Name: "com_mods\3rdmod1"; Description: "Mod 2"; Flags: exclusive
Name: "com_mods\3rdmod1"; Description: "Mod 3"; Flags: exclusive
Run Code Online (Sandbox Code Playgroud)
在Inno Setup 6 中,您可以使用WizardIsComponentSelected和WizardSelectComponents来代替索引。