ConfigMove

InstallShield 2024 » InstallScript Language Reference

The ConfigMove function moves a line in a system configuration file that has been loaded into memory with the function ConfigFileLoad. The line can be moved to the first or last position in the file or before or after a specific line in the file.

Note:Before calling the ConfigMove function, you must first call ConfigFileLoad to load the Config.sys file into memory. After you edit the file, call ConfigFileSave to save the file.

Do not mix the Ez configuration file functions with the advanced configuration file functions. After calling the ConfigFileLoad function, you cannot use the Ez configuration file functions until you use the ConfigFileSave function to save your changes.

Syntax

ConfigMove ( szMove, szRefKey, nOptions );

Parameters

ConfigMove Parameters

Parameter

Description

szMove

Specifies the line to move.

szRefKey

Specifies the key that identifies the reference line used to position the line to be moved. The position of the line to be moved is determined by the value of nOptions.

nOptions

Specifies whether you are moving the line in szMove before or after the line that contains the reference key in szRefKey. Pass one of the following predefined constants in this parameter:

BEFORE—The line specified by szMove is placed before the line containing szRefKey. If szMove is a null string (""), the line is placed before the first line in the system configuration file.
AFTER—The line specified by szMove is placed after the line containing szRefKey. If szMove is a null string (""), the line is placed after the last line in the system configuration file.

Return Values

ConfigMove Return Values

Return Value

Description

0

ConfigMove successfully moved the specified line in the system configuration file.

< 0

ConfigMove was unable to move the line.

See Also