Inno设置 - 更改任务描述标签的颜色并有换行符

时间:2016-03-05 17:23:47

标签: inno-setup pascalscript

[Components]
Name: "Slasher"; Description: "Dagon Slasher"; Types: Slasher Full
Name: "Frankenstein"; Description: "Dagon Frankenstein"; Types: Frankenstein Full

[Types]
Name: "Full"; Description: "Dagon Video Tools"
Name: "Slasher"; Description: "Dagon Slasher"
Name: "Frankenstein"; Description: "Dagon FrankenStein"

[Tasks]
Name: "Debug"; Description: "Debug. Warning: This will result in a non-functional ""Join in FrankenStein"" button in the Tools Menu."; Components: not Slasher
Name: "Vid"; Description: "Install Extra Codecs for Frankenstein"; Flags: unchecked; Components: not Slasher

我需要Warning: This will result in...显示在新行和红色字体上。我在TLama's solution中找到InnoSetup: How to add line break into component description,但结果为List index out of bounds(0),因为您可以看到,该任务会在我的脚本中有条件地显示。

1 个答案:

答案 0 :(得分:2)

如果您尝试更新RIGHT JOIN中的TasksList,则必须获得例外,因为此时InitializeWizard尚未填充,无论任务是有条件的还是不

只有在您转到“选择其他任务”页面后才会填充TasksList

因此,您只需在CurPageChanged(wpSelectTasks)中更新任务标题。在此之前测试not WizardIsComponentSelected('Slasher')(在Inno Setup 6.0.2之前TasksList)(有关详细信息,请参阅代码中的注释)。

IsComponentSelected

我很确定无法改变某项特定任务的颜色。您所能做的就是为应该具有不同颜色的每组任务创建单独的procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpSelectTasks then begin { This has to be kept in sync with the expression in "Components" parameter } { of the respective task. Though note that in your specific case the test } { is redundant as when "Slasher" is selected, you have no tasks, } { and the "Tasks" page is completely skipped, so you do not even get here. } { Before Inno Setup 6.0.2, use IsComponentSelected. } if not WizardIsComponentSelected('Slasher') then begin WizardForm.TasksList.ItemCaption[0] := 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id' + #13#10 + 'venenatis erat, ac vehicula sapien. Etiam convallis ligula eros,' + #13#10 + 'in ullamcorper turpis pulvinar sit amet.'; end; end; end; (并使用其TNewCheckListBox属性设置颜色。)

如果您想了解更多详细信息,请提出单独的问题。换行符和颜色是两个不同的问题。

另请参阅类似的问题:Disable controls based on components selection in Inno Setup