InnoSetup:如何在组件描述中添加换行符

时间:2014-07-09 19:10:00

标签: inno-setup

我正在尝试在我的描述中为我的组件添加换行符。但我似乎找不到合适的语法。

[Components]
Name: Component A; Description: "This is component A:" + NewLine + "My component A has this stuff";

2 个答案:

答案 0 :(得分:16)

[Components]部分条目不支持换行符,但您可以从代码中修改组件项描述(遗憾的是,访问该属性,该属性存储描述已编入索引且无法找到索引按组件名称)。

此示例显示如何修改第一个组件项的描述(索引基于0),以及如何向其添加换行符:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Components]
Name: "app"; Description: "Description is changed in [Code] section"
Name: "readme"; Description: "Readme File"

[Code]
procedure InitializeWizard;
begin
  WizardForm.ComponentsList.ItemCaption[0] :=
    'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id venenatis' + #13#10 +
    'erat, ac vehicula sapien. Etiam convallis ligula eros, in ullamcorper turpis' + #13#10 +
    'pulvinar sit amet.';
end;

答案 1 :(得分:6)

对于组件描述,您可以定义自定义消息,您可以在其中通过%n标记指定换行符,例如:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[CustomMessages]
ComponentDescription=Lorem ipsum dolor sit amet,%nconsectetur adipiscing elit.

[Components]
Name: "app"; Description: "{cm:ComponentDescription}"
Name: "readme"; Description: "Readme File"