GetProfString

InstallShield 2020 ยป InstallScript Language Reference

The GetProfString function retrieves a profile string from the specified .ini file. GetProfString works like the Windows API GetPrivateProfileString.

Note:GetProfString uses the functions provided by your operating environment's API to access the .ini file. Because of this, InstallShield's functionality might be limited by the operating environment.

Syntax

GetProfString ( szFileName, szSectionName, szKeyName, svResult );

Parameters

GetProfString Parameters

Parameter

Description

szFileName

Specifies the name of the .ini file from which to get the current value of a key. If szFileName is unqualified (that is, if a drive designation and path are not included), InstallShield searches for the file in the Windows folder.

szSectionName

Specifies the name of the .ini file section to search for szKeyName. The section name should not be enclosed within delimiting brackets ( [ ] ). The search for this name is not case-sensitive. To obtain a list of all section names in the initialization file, pass a null string ("") in this parameter.

Tip:To obtain a list of all section names in the initialization file, pass a null string ("") in szSectionName. The section names, delimited by null characters, are returned in the parameter svResult. svResult must be long enough to accept all of the section names. Use the StrGetTokens function to extract the individual section names from this string.

szKeyName

Specifies the key whose value is to be returned in svResult. The search for this key is not case-sensitive. To obtain a list of all key names in the section, pass a null string ("") in this parameter.

Tip:To obtain a list of all key names in the section specified by szSectionName, pass a null string ("") in szKeyName. The key names, delimited by null characters, are returned in the parameter svResult. svResult must be long enough to accept all of the key names. Use the StrGetTokens function to extract the individual key names from this string.

svResult

If szSectionName specifies a section name and szKeyName specifies a key name, the value of that key is returned in this parameter. If szSectionName specifies a null string (""), all of the section names are returned in svResult. If szKeyName specifies a null string (""), all of the key names in the section specified szSectionName are returned in svResult.

Return Values

GetProfString Return Values

Return Value

Description

0

GetProfString successfully returned the value of the profile string.

< 0

GetProfString was unable to return the value.

-2

The length of the key's value exceeded 2048 characters, which is the maximum number of characters that can be returned in svResult by GetProfString.

See Also