inno-setup

InnoSetup: How to add line break into component description


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";

Solution

  • 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;