-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathVersionInfo.dpr
More file actions
128 lines (117 loc) · 3.41 KB
/
Copy pathVersionInfo.dpr
File metadata and controls
128 lines (117 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// This tool can be used understand and figure out the various version numbers in Delphi
// It needs to be adapted for every new Delphi/RAD Studio release.
// Certain values need to be entered manually (Build No, Code Name, etc) others are determined automatically
program VersionInfo;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
type
TExtendedHelper = record helper for
Extended
function ToVersionString: string;
end;
{ TExtendedHelper }
function TExtendedHelper.ToVersionString: string;
begin
var
LFormatsettings := TFormatSettings.Create('en-us');
result := FormatFloat('0.0', self, LFormatsettings);
end;
begin
try
var
LMainVersion: Extended := 0.0;
var
LCompilerVersion := CompilerVersion;
var
LConditionalVersion := 'unknown';
var
LRTLVersionXXX := 'unknown';
var
LCodeName := 'unknown';
var
LBuildNo := 'unknown';
var
LProjectVersion: Extended := 0.0;
var
LRegPath := '\Software\Embarcadero\BDS\';
// -- D12
{$IFDEF VER360}
LConditionalVersion := 'VER360';
LCodeName := 'Athens';
var
LInternalVersion: Extended := 23.0;
{$ENDIF}
{$IF RTLVersion120}
LMainVersion := 12.0;
LRTLVersionXXX := 'RTLVersion120';
LBuildNo := '29.0.50491.5718';
{$ENDIF}
{$IF RTLVersion121}
LMainVersion := 12.1;
LRTLVersionXXX := 'RTLVersion121';
LBuildNo := '29.0.51961.7529';
LProjectVersion := 20.1;
{$ENDIF}
{$IF RTLVersion122}
LMainVersion := 12.2;
LRTLVersionXXX := 'RTLVersion122';
LBuildNo := '29.0.53571.9782';
LProjectVersion := 20.2;
{$ENDIF}
{$IF RTLVersion123}
LMainVersion := 12.3;
LRTLVersionXXX := 'RTLVersion123';
LBuildNo := '29.0.55362.2017';
LProjectVersion := 20.3;
{$ENDIF}
// -- D13
{$IFDEF VER370}
LConditionalVersion := 'VER370';
LCodeName := 'Florence';
var
LInternalVersion: Extended := 37.0;
{$ENDIF}
{$IF RTLVersion=37}
{$IF RTLVersion131}
LMainVersion := 13.1;
LRTLVersionXXX := 'RTLVersion131';
LBuildNo := '37.0.59082.6021';
LProjectVersion := 20.4;
{$ELSE}
LMainVersion := 13.0;
LRTLVersionXXX := 'RTLVersion = 37';
LBuildNo := '37.0.57242.3601';
LProjectVersion := 20.3;
{$ENDIF}
{$ENDIF}
var
LRTLVersion: Extended := RTLVersion;
var
LProductVersion:integer;
try
LProductVersion := LBuildNo.Split(['.'])[0].ToInteger;
except
LProductVersion := -1;
end;
var
LPackageversion := LProductVersion * 10;
Writeln('Main Version: ' + LMainVersion.ToVersionString);
Writeln('Code Name: ' + LCodeName);
Writeln('Conditional : ' + LConditionalVersion);
Writeln('Product Version : ' + LProductVersion.ToString);
Writeln('Build No. : ' + LBuildNo);
Writeln('Package Version : ' + LPackageversion.ToString);
Writeln('Compiler Version: ' + LCompilerVersion.ToVersionString);
Writeln('RTLVersionXXX : ' + LRTLVersionXXX);
Writeln('RTLVersion : ' + LRTLVersion.ToVersionString);
Writeln('Internal Version : ' + LInternalVersion.ToVersionString);
Writeln('Project Version: ' + LProjectVersion.ToVersionString);
Writeln('Registry Path :' + LRegPath + LInternalVersion.ToVersionString);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.