ConfigFileSave

InstallShield 2016 » InstallScript Language Reference

The ConfigFileSave function saves to disk a system configuration file that has been loaded into memory with the function ConfigFileLoad. The file is saved under its original name. If a file name is specified in szBackupFile, the original file is renamed with that file name before the edited file is written to disk. If szBackupFile contains a null string (""), the original file is replaced with the modified file. If you do not call ConfigFileSave when you are finished modifying a system configuration file with advanced configuration file functions, all modifications will be lost.

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

ConfigFileSave ( szBackupFile );

Parameters

ConfigFileSave Parameters

Parameter

Description

szBackupFile

Specifies whether or not a backup copy of the original file as it existed before editing should be saved, according to the following criteria:

If no backup file should be created, specify a null string in this parameter.
If the original file should be backed up with a specific name, pass that file name in this parameter. The file name must be unqualified (that is, do not specify a drive and/or path). Note that if a file with the specified name already exists, ConfigFileSave generates a unique file extension, as described in the next bullet item.
If the original file should be backed up with an installation-generated file extension, specify the wildcard character (*) as the file extension (for example, "Config.*"). The installation then assigns a numeric value, starting at 001, as the extension. If a file already exists with that extension, the extension's value is increased by one until a unique file name is created.

Once the backup has been created, InstallShield stores the backup file name in the system variable INFOFILENAME.

Return Values

ConfigFileSave Return Values

Return Value

Description

0

ConfigFileSave successfully wrote the file from memory to disk.

< 0

ConfigFileSave was unable to write the file to disk.

See Also