GetFileVersion Method (path)

Microsoft Deployment Tools

Deployment Tools Foundation GetFileVersion Method (path)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerInstallerGetFileVersion(String)
Gets the version string of the path specified using the format that the installer expects to find it in in the database.
Declaration Syntax
C# Visual Basic Visual C++
public static string GetFileVersion(
	string path
)
Public Shared Function GetFileVersion ( _
	path As String _
) As String
public:
static String^ GetFileVersion(
	String^ path
)
Parameters
path (String)
Path to the file
Return Value
Version string in the "#.#.#.#" format, or an empty string if the file does not contain version information
Remarks

Win32 MSI API: MsiGetFileVersion

Exceptions
Exception Condition
FileNotFoundException the file does not exist or could not be read

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller) Version: 3.0.0.0 (3.5.1623.0)