BatchFileSave

InstallShield 2016 » InstallScript Language Reference

The BatchFileSave function saves to disk a batch file that has been loaded into memory with the function BatchFileLoad. 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 BatchFileSave when you are finished modifying a batch file with advanced batch file functions, all modifications will be lost.

Note • Do not mix the Ez batch file functions with the advanced batch file functions. After calling BatchFileLoad, you cannot use Ez batch file functions until you have called BatchFileSave to save the file.

Syntax

BatchFileSave ( szBackupFile );

Parameters

BatchFileSave Parameters

Parameter

Description

szBackupFile

Specifies whether a backup copy of the original file as it existed before editing should be saved.

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, BatchFileSave will generate 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, "Batch."). The installation will then assign a numeric value, starting at 001, as the extension. If a file already exists with that extension, the extension's value will be 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.

Note • If the batch file specified by the last call to BatchFileLoad did not exist, then the backup file is identical to the batch file created by the call to BatchFileSave. If szBackupFile specifies the name of the original batch file, then a backup file is not created.

Return Values

BatchFileSave Return Values

Return Value

Description

0

BatchFileSave successfully saved the batch file in memory to disk.

< 0

BatchFileSave was unable to save the batch file to disk.

See Also