Inno Setup Preprocessor: #insert

Syntax

insert-directive: insert <expr>

Description

Changes the insertion point. By default, each processed line is appended to the end of the preprocessor output. Using insert the point at which the next processed line will be inserted into the preprocessor output can be set. insert takes an expression which must evaluate to a 0-based line index. If this index is 0, the next processed line is inserted at the beginning of the preprocessor output. If this index is 1, the next processed line is put in the second position of the preprocessor output, and so on.

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.