InstallShield 2016 » InstallScript Language Reference
Call the GetFileInfo function to determine a file's or directory's attributes, modify date, time, MD5 signature, or size. In each GetFileInfo statement, you can request only one of the data. For example, to obtain the date and time information for a file or directory, you must call GetFileInfo twice—once to obtain the date and once to obtain the time.
Syntax
GetFileInfo ( szPathName, nType, nvResult, svResult );
Parameters
Parameter |
Description |
||||||||||||||||||||||||
szPathName |
Specifies the fully qualified name of the file or directory about which you want to retrieve information. You can specify a valid Uniform Resource Locator (URL) in this parameter unless you pass FILE_ATTRIBUTE or FILE_SHARED_COUNT as the nType parameter, in which case the function fails and returns ISERR_INVALID_ARG. To check the validity of a URL, call Is(VALID_PATH, szURL). |
||||||||||||||||||||||||
nType |
Specifies the type of file or directory information to retrieve. If the information is a number, GetFileInfo places it in nvResult. If the information is a string, GetFileInfo places it in svResult. Pass one of the following predefined constants in this parameter:
Note • Raw MD5 signature data for a particular file consists of 16 generated numeric values of 16 bit each (between 0x00 abd 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.
|
||||||||||||||||||||||||
|
Note • After calling GetFileInfo with FILE_ATTRIBUTE as the second parameter (nType), use if-then-else logic to determine the file's or directory's attributes. If nvResult = FILE_ATTR_NORMAL, then no attributes are set. If nvResult != FILE_ATTR_NORMAL, test the result of bitwise AND (&) operations on nvResult and one or more of the following file attribute constants to determine which attributes are set:
if (nvResult = FILE_ATTR_NORMAL) then //The file is NORMAL. else if (FILE_ATTR_HIDDEN & nvResult) then //The file is HIDDEN. endif;
if (FILE_ATTR_READONLY & nvResult) then //The file is READ-ONLY. endif; endif; |
||||||||||||||||||||||||
nvResult |
Returns numeric information. |
||||||||||||||||||||||||
svResult |
Returns string information. |
Return Values
Return Value |
Description |
0 |
Indicates that the function successfully retrieved the requested file information. |
ISERR_INVALID_ARG (-2) |
Indicates that an invalid argument was passed to the function. |
All other negative values |
Indicates that the function was unable to retrieve the requested information. |
See Also
InstallShield 2016 Help LibraryMay 2017 |
Copyright Information | Flexera Software |