12

I am trying to add a line break in the middle of my description for my components. But I can't seem to find the proper syntax for it.

[Components]
Name: Component A; Description: "This is component A:" + NewLine + "My component A has this stuff";
Evan Miller
  • 369
  • 4
  • 13
  • 1
    Perhaps the information in [Long descriptions on inno-setup components](http://stackoverflow.com/q/10867087) can help. – Ken White Jul 09 '14 at 19:54

2 Answers2

22

Line breaks are not supported for [Components] section entries, but you can modify your component item descriptions from code (unfortunately, access to the property, which stores a description is indexed and there is no way to find an index by the component name).

This example shows how to modify the first component item's description (indexing is 0 based), and how to add a line break to it:

[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;
TLama
  • 75,147
  • 17
  • 214
  • 392
9

For the component description you can define a custom message where you can specify line breaks by the %n tags, e.g.:

[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"
TLama
  • 75,147
  • 17
  • 214
  • 392
Jerry Zoden
  • 332
  • 2
  • 9
  • @Jerry, `%n` in a `[Components]` entry `Description` won't produce line breaks. That's what you can do in `[CustomMessages]` section entries. But the principle of making line breaks through custom messages is much better than my idea. – TLama Aug 23 '14 at 13:50