MSI Factory 2.3

File.GetVersionInfo

File.GetVersionInfo

This is the first topic This is the last topic  

File.GetVersionInfo

This is the first topic This is the last topic  

OverviewExamples

table File.GetVersionInfo (

string Filename )

Example 1

version_info = File.GetVersionInfo( _WindowsFolder .. "\\Doopernator\\Doopernator.exe");

fv = version_info.FileVersion;

pv = version_info.ProductVersion;

Gets the version info for the "C:\Windows\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.

Example 2

-- Get the file information, and load it into a table

tVersionInfo = File.GetVersionInfo(_SourceDrive .. "\\setup.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 "setup.exe, and presents it to the user in a single dialog message.

See also: Related Actions


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us