FeatureFileInfo

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

Note that this function does not work with files in InstallScript Object projects.

The FeatureFileInfo retrieves information on a file in the file media that is referenced by szFeatureSource (MEDIA).

Note: This function cannot be used with script-created features.

Syntax

FeatureFileInfo ( szFeatureSource, szFeature, szFile, nInfo, nvResult, svResult );

Parameters

FeatureFileInfo Parameters

Parameter

Description

szFeatureSource

Pass MEDIA in this parameter.

szFeature

Specifies the feature containing the component in which the file is found.

szFile

Specifies the component and the file name, with or without a path. Delimit tokens in the szFile expression with double backslashes and enclose the expression in double quotation marks.

If there are two tokens in szFile, the first is the component name and the second is the file name:

“component\\file name”

If there are more than two tokens in szFile, the first is the component name, the last is the file name, and the middle tokens form the path:

"component\\path\\file name"

For example:

"Shared_Files\\Is5.dll"—Shared_Files is a component and Is5.dll is a file name.
"Shared_Files\\dev\\myapp\\dlls\\Is5.dll"—Shared_Files is a component, \\dev\\myapp\\dlls is a path, and Is5.dll is a file name.

Note: InstallShield lets you add entire file and folder structures to your components by dragging and dropping them in the Files view.

nInfo

Specifies the type of information to be retrieved. Pass a constant in this parameter. The available constants apply to either a specified component, or a specified file in a component.

The available file-specific constants are:

FEATURE_INFO_ATTRIBUTE—Attribute values for the specified file. For more information about the File table attributes that are returned, see the Windows Installer Help. Only InstallScript MSI projects support this constant; InstallScript projects do not support it.
FEATURE_INFO_DATE—Date value for the specified file in the format mm-dd-yy. Only InstallScript projects support this constant; InstallScript MSI projects do not support it. If this constant is used with FeatureFileInfo in an InstallScript MSI installation, the function returns failure.
FEATURE_INFO_DATE_EX—Date value for the specified file in the 2000-compliant format mm-dd-yyyy. Only InstallScript projects support this constant; InstallScript MSI projects do not support it. If this constant is used with FeatureFileInfo in an InstallScript MSI installation, the function returns failure.
FEATURE_INFO_TIME—Time value for the specified file in the format hh:mm, using 24-hour time. Only InstallScript projects support this constant; InstallScript MSI projects do not support it. If this constant is used with FeatureFileInfo in an InstallScript MSI installation, the function returns failure.
FEATURE_INFO_VERSIONLS—The minor version number or numbers in string form.
FEATURE_INFO_VERSIONMS—The major version number or numbers in string form.
FEATURE_INFO_VERSIONSTR—The entire version number in string form.
FEATURE_INFO_MD5_SIGNATURE—Returns the MD5 signature of the file specified by szFile. Note that this information is generated during the media build, so calling this function with this parameter does not cause the MD5 signature to be generated.

Note: Raw MD5 signature data for a particular file consists of 16 generated numeric values of 16 bit each (between 0x00 and 0xFF). These values are usually stored in a string of unsigned characters. However, the InstallScript language does not support unsigned characters, so instead of returning the raw MD5 file data, each of the 16 numeric values are converted to their string equivalent and placed in the resulting string. This results in a string of 32 characters, where each set of two characters represent a single numeric value. This is sometimes referred to as a MD5 hex string.

nInfo (cont.)

FEATURE_INFO_ORIGSIZE_HIGH—Returns the upper 31 bits of size of the original file. If the original size of the file is more than 2 GB, the size of the file is equal to the value returned for FEATURE_INFO_ORIGSIZE_HIGH multiplied by 2 GB added to the value returned for FEATURE_INFO_ORIGSIZE_LOW. Only InstallScript installations support this constant.
FEATURE_INFO_ORIGSIZE_LOW—Returns the lower 31 bits of size of the original file. If the original size of the file is more than 2 GB, the size of the file is equal to the value returned for FEATURE_INFO_ORIGSIZE_HIGH multiplied by 2 GB added to the value returned for FEATURE_INFO_ORIGSIZE_LOW.
FEATURE_INFO_COMPSIZE_LOW—Returns the lower 31 bits of size of the compressed file. If the compressed size of the file is more than 2 GB, the size of the file is equal to the value returned for FEATURE_INFO_COMPSIZE_HIGH multiplied by 2 GB added to the value returned for FEATURE_INFO_COMPSIZE_LOW.
FEATURE_INFO_COMPSIZE_HIGH—Returns the upper 31 bits of size of the compressed file. If the original size of the file is more than 2 GB, the size of the file is equal to the value returned for FEATURE_INFO_ORIGSIZE_HIGH multiplied by 2 GB added to the value returned for FEATURE_INFO_ORIGSIZE_LOW. Only InstallScript installations support this constant.

Note: You can use the ConvertSizeToUnits function to convert these values into a single value of KBYTES, MBYTES, GBYTES, or TBYTES.

nInfo (cont.)

The available component-specific constants are:

FEATURE_INFO_COMPONENT_FLAGS—General flags that are set for the specified component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_DESTINATION—Destination setting for the component. Note that any text substitutions that are included in the destination are not resolved in the returned string. To determine the component's destination with any text substitutions resolved, call TextSubSubstitute on the returned string.
FEATURE_INFO_DOTNET—.NET flags that are selected for the specified component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_FTPLOCATION—FTP Location setting for the specified component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_HTTPLOCATION—HTTP Location setting for the specified component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_LANGUAGE—Languages setting for the specified component. Because this applies only to a component, szFile must be a single token expression identifying a component.
FEATURE_INFO_MISC—Miscellaneous setting for the specified component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_OS—Operating System setting for the specified component. Because this applies only to a component, szFile must be a single token expression that identifies a component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_OVERWRITE—Overwrite flags that are set for the specified component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_PLATFORM_SUITE—Platform Suites setting for the specified component. Because this applies only to a component, szFile must be a single token expression that identifies a component. Only InstallScript projects support this constant; InstallScript MSI projects do not support it.

nvResult

Specifies information that is dependent on the constant that is passed in nInfo.

When nInfo is FEATURE_INFO_ORIGSIZE_HIGH, FEATURE_INFO_ORIGSIZE_LOW, or FEATURE_INFO_ATTRIBUTE, nvResult returns a number value.

When nInfo is FEATURE_INFO_ATTRIBUTE, nvResult returns a numeric value that represents the file attributes from the Windows Installer File table. To determine the file attribute settings, use file attribute constants in bitwise OR operations with nvResult. For an example of how to test nvResult, see FeatureFileInfo Example. For more information about the File table attributes, see the Windows Installer Help.

When nInfo is FEATURE_INFO_LANGUAGE or FEATURE_INFO_OS, the parameter position occupied by nvResult must specify a LIST variable to store the language or operating system IDs. You must call ListCreate with the constant NUMBERLIST to create the list before you call FeatureFileInfo to determine which languages or operating systems are specified by the component:

listID = ListCreate(NUMBERLIST);

FeatureFileInfo(szFeatureSource, szFeature, szFile, FEATURE_INFO_LANGUAGE, listID, svResult);

When nInfo is FEATURE_INFO_LANGUAGE, FeatureFileInfo adds language IDs to the list; when nInfo is FEATURE_INFO_OS, FeatureFileInfo adds operating system IDs to the list.

When ninfo is FEATURE_INFO_COMPONENT_FLAGS, nvResult returns one or more of the following values:

FEATURE_INFO_COMPONENT_FLAG_COMPRESSED—The component’s Compressed setting is Yes.
FEATURE_INFO_COMPONENT_FLAG_DATAASFILES—The component’s files are placed in a particular folder for a CD-ROM type of release. (This is determined by the CD-ROM Folder setting for the feature that contains the component.) Only InstallScript projects support this constant; InstallScript MSI projects do not support it.
FEATURE_INFO_COMPONENT_FLAG_DONTUNINSTALL—The component’s Uninstall setting is No.
FEATURE_INFO_COMPONENT_FLAG_ENCRYPTED—The component is encrypted. (This is determined by whether the feature that includes the component has Yes selected for its Encryption setting.)
FEATURE_INFO_COMPONENT_FLAG_POTENTIALLYLOCKED—The component’s Potentially Locked setting is Yes.
FEATURE_INFO_COMPONENT_FLAG_SELFREGISTERING—The component’s Self-Register setting is Yes.
FEATURE_INFO_COMPONENT_FLAG_SHARED—The component’s Shared setting is Yes.

nvResult (cont.)

When ninfo is FEATURE_INFO_OVERWRITE, nvResult returns one or more of the following values:

FEATURE_VALUE_ALWAYS—The component’s Overwrite setting is Always.
FEATURE_VALUE_DATE_NEWER—The component’s Overwrite setting is Newer Date.
FEATURE_VALUE_DATE_OLDER—The component’s Overwrite setting is Older Date.
FEATURE_VALUE_DATE_SAME—The component’s Overwrite setting is Same or Newer Date.
FEATURE_VALUE_NEVER—The component’s Overwrite setting is Never.
FEATURE_VALUE_VERSION_NEWER—The component’s Overwrite setting is Newer Version.
FEATURE_VALUE_VERSION_OLDER—The component’s Overwrite setting is Older Version.
FEATURE_VALUE_VERSION_SAME—The component’s Overwrite setting is Same or Newer Version.

Note that nvResult could contain both date and version values.

When ninfo is FEATURE_INFO_DOTNET, nvResult may return the following value:

FEATURE_VALUE_LOCAL_ASSEMBLY—The component is marked as a local assembly.

svResult

Returns the date, time, or version when nInfo specifies a corresponding information type.

Return Values

FeatureFileInfo Return Values

Return Value

Description

0

FeatureFileInfo was successful.

<0

FeatureFileInfo failed.

See Also