I need a way to get the version of my application in C ++ Builder , to put in the Caption of a TLabel
, which will be displayed next to a home screen system presentation.
I need a way to get the version of my application in C ++ Builder , to put in the Caption of a TLabel
, which will be displayed next to a home screen system presentation.
Similar to your question in SOen .
But as this is Delphi, I use a function that works both in Builder and Delphi:
function GetAppVersion: string;
var
Versao: LongRec;
begin
Versao:= LongRec(GetFileVersion(ParamStr(0)));
Result := Format('%d.%d', [Versao.Hi, Versao.Lo])
end;
To use just receive the result of the GetAppVersion
function in the Caption of the component.
Where:
Versao.Hi = Major Version
Versao.Lo = Minor Version