1
0
mirror of synced 2024-12-22 17:23:07 +01:00

Added: option to include Product Name in FormatVersion

This commit is contained in:
Mark van Renswoude 2004-08-22 19:38:26 +00:00
parent e44bcd3706
commit cdf35a6cdb

View File

@ -138,9 +138,11 @@ type
destructor Destroy(); override;
//:$ Returns the formatted version information
//:: If Build is False, the return value will not include the
//:: application's Build number.
function FormatVersion(Build: Boolean = True): String;
//:: If ABuild is False, the return value will not include the
//:: application's Build number. If AProductName is True, the
//:: product name will be included as well.
function FormatVersion(const ABuild: Boolean = True;
const AProductName: Boolean = False): String;
//:$ Contains the path to the application's executable
//:! This path in unaffected by the working directory which may be
@ -294,11 +296,15 @@ var
begin
sBuild := '';
if Build then
if ABuild then
sBuild := Format(' build %d', [FVersion.Build]);
Result := '';
if AProductName then
Result := FVersion.Strings.ProductName + ' ';
with FVersion do
Result := Format('v%d.%d.%d%s', [Major, Minor, Release, sBuild]);
Result := Result + Format('v%d.%d.%d%s', [Major, Minor, Release, sBuild]);
end;