Fixed: crash due to uncreated App.FVersion
Added: OS.FormatVersion method
This commit is contained in:
parent
c5c46e76b5
commit
85567ecbdd
@ -254,6 +254,8 @@ constructor TX2App.Create;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
FVersion := TX2AppVersion.Create();
|
||||
|
||||
GetPath();
|
||||
GetVersion();
|
||||
end;
|
||||
|
20
X2UtOS.pas
20
X2UtOS.pas
@ -85,6 +85,11 @@ type
|
||||
constructor Create();
|
||||
destructor Destroy(); override;
|
||||
|
||||
//:$ Returns the formatted version information
|
||||
//:: If Build is False, the return value will not include the
|
||||
//:: OS' Build number.
|
||||
function FormatVersion(Build: Boolean = True): String;
|
||||
|
||||
//:$ Contains the detected OS version
|
||||
property Version: TX2OSVersion read FVersion;
|
||||
|
||||
@ -206,6 +211,21 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function TX2OS.FormatVersion;
|
||||
var
|
||||
sBuild: String;
|
||||
|
||||
begin
|
||||
sBuild := '';
|
||||
|
||||
if Build then
|
||||
sBuild := Format(' build %d', [FVersionEx.Build]);
|
||||
|
||||
with FVersionEx do
|
||||
Result := Format('%s %s%s', [Name, VersionString, sBuild]);
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
finalization
|
||||
FreeAndNil(GOS);
|
||||
|
Loading…
Reference in New Issue
Block a user