GetTempFileNameIS

InstallShield 2018 » InstallScript Language Reference

The GetTempFileNameIS function calls the Windows API GetTempFileName to create a temporary file and perform related actions. Note that unlike the Windows API GetTempFileName, GetTempFileNameIS creates the folder specified by szPathName if it does not already exist. Note that as with the CreateDir function, the newly created folder or folders are not logged for uninstallation.

Syntax

GetTempFileNameIS( byval string szPathName, byval string szPrefixString, byval number nUnique, byref string svTempFileName, byval number nOptions );

Parameters

GetTempFileNameIS Parameters

Parameter

Description

szPathName

Specifies the path for the lpPathName parameter of the Windows API GetTempFileName.

You can use text substitutions for this parameter.

szPrefixString

Specifies the string for the lpPrefixString parameter of the Windows API GetTempFileName.

You can use text substitutions for this parameter.

nUnique

Specifies the integer for the nUnique parameter of the Windows API GetTempFileName.

svTempFileName

Specifies the value for the lpTempFileName parameter of the Windows API GetTempFileName.

Note • InstallScript strings are automatically _MAX_PATH or greater in length. Therefore, there is no need to manually size this string.

nOptions

Specifies an InstallScript-specific option. Pass any of the following predefined constants in this parameter:

GTFIS_OPTION_NONE—No InstallScript-specific options. This is the default option.
GTFIS_OPTION_DONT_RESOLVE_TEXTSUBS—Do not call TextSubSubstitute to resolve text substitutions in szPathName and szPrefixString.
GTFIS_OPTION_DONT_CREATE_DIR—Do not create the directory specified by szPathName if it does not already exist. Note that if this option is specified and szPathName does not exist, the function fails.
GTFIS_OPTION_DELETE_TEMP_FILE—Delete the created temporary file before returning. (Note that this option is useful only if you specify nUnique such that the function creates a temporary file. For more information, see GetTempFileName Function.) The function does not return failure if the temporary file cannot be deleted.

Return Values

GetTempFileNameIS Return Values

Return Value

Description

>= ISERR_SUCCESS

Indicates that the function was successful.

< ISERR_SUCCESS

Indicates that the function was not successful.