Inno Setup Preprocessor: #insert

Syntax

insert-directive: insert <expr>

Description

Changes the insertion point. By default, each processed line is added to the end of the preprocessor output. Using insert the point at which the next processed line will be added to the preprocessor output can be changed. insert takes an expression which must evaluate to an integer. The insertion point will be set to this integer.

The insertion point is also always automatically incremented each time after a line has been added to the preprocessor output, so that each new line is inserted after the one previously inserted.

It is not recommended to use script generating functions (such as SetSetupSetting) which may insert a line by themselves, thus shifting a part of the preprocessor output one line down, whereas insertion point is not updated. This may result in different insertion point than expected.

The Find function can be used to produce values for the insert directive.

Examples

#insert FindSectionEnd("Icons")
#insert FindSection("Setup") + 1
#insert Find(0, "somefile.ext", FIND_CONTAINS)

See also

append.