GetFileVersion Method (path)

Microsoft Deployment Compression & Installer

Copy image CopyHover image
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
String
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.dll) Version: 3.0.0.0 (3.9.1006.0)