Reads information about a file on the user's system and stores that information in a variable.
Action ID: 29
Action Category:
File Information
What information do you want to find out about the file? Choose from:
Version |
- |
The version of the file. This will only work with files that have embedded resourse information, such as EXE or DLL files. |
CRC Value |
- |
The CRC value of the file. |
Size |
- |
The size of the file in bytes. |
Existence |
- |
Whether or not the file exists. Sets the variable to "TRUE" if the file exists, and sets the variable to the Default value if it doesn't. |
Short file name |
- |
The short filename (i.e. the "8.3 filename" or "DOS filename") of the file. |
The name of the variable to assign the result to.
The default value to assign to the variable if the file information cannot be determined or if the file does not exist.
The name of the file to investigate.
Value |
Simple Message |
Verbose Message |
0 (OK) |
|
|
1 |
Could not read file information. |
Could not read file version. |
2 |
Could not read file information. |
Could not calculate file CRC. |
3 |
Could not read file information. |
Could not determine file size. |
In this example, we will find out what version of Notepad the user has on their system.
File information to collect -
Version
Variable name
- %NotepadVersion%
Default value
- 0.0.0.0
File name
- %WinDir%\Notepad.exe
In this example, we will read in the CRC of our main executable "MyProgram.exe" from our main application directory. We will store this information in a custom variable named %MyProgramCRC%.
By reading in the CRC value, we could compare it to a list of valid CRC values. This would be useful if we wanted to make sure the user did not have a "stolen" copy of our software.
File information to collect:
CRC Value
Variable name: %MyProgramCRC%
Default value: 0
File name: %AppDir%\MyProgram.exe
See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab