Board index » cppbuilder » Package ProductVersion
Jens Ivar Jørdre
CBuilder Developer |
Jens Ivar Jørdre
CBuilder Developer |
Package ProductVersion2006-08-18 06:00:23 PM cppbuilder42 Hi, I would like to retrieve the major, minor and revision numbers from some bpls at run time. Using GetFileVersion() in SysUtils I am only able to retrieve the major and minor numbers. Does anyone know of Borland functions to retrieve all three numbers? Possibly I could use GetPackageInfo() but the documentation about it in BDS is incomplete. Kind regards Jens Ivar Jørdre |
Frode Nilsen
CBuilder Developer |
2006-08-18 06:28:11 PM
Re:Package ProductVersion
Jens Ivar Jørdre wrote:
QuoteHi, versjon_info( const std::string& path ) { std::string retval; DWORD dwHandle; DWORD size( GetFileVersionInfoSize( const_cast<char*>( path.c_str() ), &dwHandle ) ); if( size ) { char* buffer( new char[size] ); if( GetFileVersionInfo( const_cast<char*>( path.c_str() ), 0, size, buffer ) ) { char* tmp; UINT length; if( VerQueryValue( buffer, "FileVersion", reinterpret_cast<void**>( &tmp ), &length ) ) { retval.assign( tmp, length ); } } delete[] buffer; } return retval; } -- frode |