1
0
mirror of synced 2024-12-22 09:13:07 +01:00

Fixed: crash due to uncreated App.FVersion

Added: OS.FormatVersion method
This commit is contained in:
Mark van Renswoude 2004-06-07 10:27:08 +00:00
parent c5c46e76b5
commit 85567ecbdd
2 changed files with 22 additions and 0 deletions

View File

@ -254,6 +254,8 @@ constructor TX2App.Create;
begin
inherited;
FVersion := TX2AppVersion.Create();
GetPath();
GetVersion();
end;

View File

@ -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);