OverviewExamples
version_info = File.GetVersionInfo( _ProgramFilesFolder .. "\\Doopernator\\Doopernator.exe");
fv = version_info.FileVersion;
pv = version_info.ProductVersion;
Gets the version info for the "C:\Program Files\Doopernator\Doopernator.exe" file and stores it in a table named version_info. Then copies the file version and product version from that table into variables named fv and pv, respectively.
Note: _ProgramFilesFolder is a built-in variable that contains the path to the user's Program Files directory.
-- Get the file information, and load it into a table
tVersionInfo = File.GetVersionInfo(_SourceFolder .. "\\update.exe");
-- Get the last error code
nError = Application.GetLastError();
if nError == 0 then
-- There was not an error
sOutput = "";
-- Traverse the table, storing info in a string
for Name, Contents in tVersionInfo do
sOutput = sOutput .. Name .. ": " .. Contents .. "\r\n";
end
-- Output string contents to the user
Dialog.Message("File Version Information", sOutput);
else
-- There was an error, alert the user
Dialog.Message("Error", _tblErrorMessages[nError]);
end
Retrieves the version information from the file "update.exe, and presents it to the user in a single dialog message.
Note: _SourceFolder is a built-in variable that contains the path to the location the update.exe is run from.
See also: Related Actions