Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The MsiGetFileVersion returns the version string and language string in the format that the installer expects to find them in the database. If you want only version information, set lpLangBuf and pcchLangBuf to 0 (zero). If you just want language information, set lpVersionBuf and pcchVersionBuf to 0 (zero).
UINT MsiGetFileVersionA(
[in] LPCSTR szFilePath,
[out] LPSTR lpVersionBuf,
[in, out] LPDWORD pcchVersionBuf,
[out] LPSTR lpLangBuf,
[in, out] LPDWORD pcchLangBuf
);
[in] szFilePath
Specifies the path to the file.
[out] lpVersionBuf
Returns the file version.
Set to 0 for language information only.
[in, out] pcchVersionBuf
In and out buffer count as the number of TCHAR.
Set to 0 (zero) for language information only. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.
[out] lpLangBuf
Returns the file language.
Set to 0 (zero) for version information only.
[in, out] pcchLangBuf
In and out buffer count as the number of TCHAR.
Set to 0 (zero) for version information only. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.
Value | Meaning |
---|---|
|
Successful completion. |
|
File does not exist. |
|
File cannot be opened to get version information. |
|
File does not contain version information. |
|
The version information is invalid. |
|
Unexpected error. |
Note
The msi.h header defines MsiGetFileVersion as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version. |
Target Platform | Windows |
Header | msi.h |
Library | Msi.lib |
DLL | Msi.dll |
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!