EzConfigAddString

InstallShield 2019 » InstallScript Language Reference

The EzConfigAddString function adds a line of text to the default system configuration file. You can specify the position of the line you add in reference to another statement in the file.

Unless changed by a call to ConfigSetFileName, the default system configuration file is the Config.sys file that was executed by the system during the boot sequence. To make another file the default system configuration file, call ConfigSetFileName. To determine the fully qualified name of the default system configuration file, call ConfigGetFileName.

Note • Do not mix the Ez configuration file functions and the advanced configuration file functions. After calling ConfigFileLoad, you cannot call any of the Ez configuration file functions until you call ConfigFileSave to save the file.

Syntax

EzConfigAddString ( szLine, szRefKey, nOptions );

Parameters

EzConfigAddString Parameters

Parameter

Description

szLine

Specifies the line of text to add to the system configuration file.

szRefKey

Specifies the reference key relative to which you want to position szLine in the system configuration file. EzConfigAddString searches the system configuration file for the reference key and places the contents of the parameter szLine before or after the line containing the key, depending on which constants is passed in nOptions.

nOptions

Indicates whether the line specified by szLine is to be added before or after the line containing szRefKey. Pass one of the following predefined constants in this parameter:

BEFORE—The line specified by szLine is added before the line containing szRefKey. If szRefKey contains a null string (""), szLine is inserted as the first line of the system configuration file.
AFTER—The line specified by szLine is added after the line containing szRefKey. If szRefKey contains a null string (""), szLine is inserted as the last line of the system configuration file.

Return Values

EzConfigAddString Return Values

Return Value

Description

0

EzConfigAddString successfully added the string to the default system configuration file.

< 0

EzConfigAddString was unable to add the text string.

See Also