Added: option to include Product Name in FormatVersion
This commit is contained in:
parent
e44bcd3706
commit
cdf35a6cdb
18
X2UtApp.pas
18
X2UtApp.pas
@ -138,9 +138,11 @@ type
|
|||||||
destructor Destroy(); override;
|
destructor Destroy(); override;
|
||||||
|
|
||||||
//:$ Returns the formatted version information
|
//:$ Returns the formatted version information
|
||||||
//:: If Build is False, the return value will not include the
|
//:: If ABuild is False, the return value will not include the
|
||||||
//:: application's Build number.
|
//:: application's Build number. If AProductName is True, the
|
||||||
function FormatVersion(Build: Boolean = True): String;
|
//:: 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
|
//:$ Contains the path to the application's executable
|
||||||
//:! This path in unaffected by the working directory which may be
|
//:! This path in unaffected by the working directory which may be
|
||||||
@ -294,11 +296,15 @@ var
|
|||||||
begin
|
begin
|
||||||
sBuild := '';
|
sBuild := '';
|
||||||
|
|
||||||
if Build then
|
if ABuild then
|
||||||
sBuild := Format(' build %d', [FVersion.Build]);
|
sBuild := Format(' build %d', [FVersion.Build]);
|
||||||
|
|
||||||
|
Result := '';
|
||||||
|
if AProductName then
|
||||||
|
Result := FVersion.Strings.ProductName + ' ';
|
||||||
|
|
||||||
with FVersion do
|
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;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user