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
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
|
FVersion := TX2AppVersion.Create();
|
||||||
|
|
||||||
GetPath();
|
GetPath();
|
||||||
GetVersion();
|
GetVersion();
|
||||||
end;
|
end;
|
||||||
|
20
X2UtOS.pas
20
X2UtOS.pas
@ -85,6 +85,11 @@ type
|
|||||||
constructor Create();
|
constructor Create();
|
||||||
destructor Destroy(); override;
|
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
|
//:$ Contains the detected OS version
|
||||||
property Version: TX2OSVersion read FVersion;
|
property Version: TX2OSVersion read FVersion;
|
||||||
|
|
||||||
@ -206,6 +211,21 @@ begin
|
|||||||
end;
|
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
|
initialization
|
||||||
finalization
|
finalization
|
||||||
FreeAndNil(GOS);
|
FreeAndNil(GOS);
|
||||||
|
Loading…
Reference in New Issue
Block a user