Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Die Delphi-IDE (https://www.delphipraxis.net/62-die-delphi-ide/)
-   -   Delphi-Version ermitteln (https://www.delphipraxis.net/212816-delphi-version-ermitteln.html)

lxo 6. Apr 2023 10:56

Delphi-Version ermitteln
 
Hallo,

gibt es eine Variable/Konstante in Delphi die mir die genaue Delphi Version gibt?

Ich zeige die Version in meinen Versionsinformationen an.
Aktuell verwende ich Compilerversion.
Diese unterscheidet sich aber nicht zwischen 11.2 und 11.3.
Gibt es da was womit ich genau identifizieren könnte, dass die EXE mit Delphi 11.3 erzeugt wurde?

Uwe Raabe 6. Apr 2023 11:17

AW: Delphi-Version ermitteln
 
Delphi-Quellcode:
{$IF CompilerVersion = 35} 
  {$IF Declared(RTLVersion113)} 
    // Delphi 11.3
  {$ELSEIF Declared(RTLVersion112)} 
    // Delphi 11.2
  {$ELSEIF Declared(RTLVersion111)} 
    // Delphi 11.1
  {$ELSE} 
    // Delphi 11.0
  {$IFEND}
{$IFEND}

lxo 6. Apr 2023 12:51

AW: Delphi-Version ermitteln
 
Und was ist mit Versionen vor 11?

TiGü 6. Apr 2023 13:01

AW: Delphi-Version ermitteln
 
Das gleiche in Grün nur halt mit den entsprechenden Werten.
https://delphidabbler.com/notes/version-numbers

haentschman 6. Apr 2023 13:03

AW: Delphi-Version ermitteln
 
https://delphidabbler.com/notes/version-numbers

Klaus01 6. Apr 2023 13:20

AW: Delphi-Version ermitteln
 
..da Delphi 11.3 keine neue Hauptversion ist - gibt es nur eine Compilerversion für Delphin 11.

Grüße
Klaus

himitsu 6. Apr 2023 14:34

AW: Delphi-Version ermitteln
 
Sie "hätten" aber auch einfach CompilerVersionen 35.0 35.1 35.2 35.3 machen können. :freak:

Gab es die RTLVersion nicht auch als Konstante?
[edit] Doch, aber RTLVersion <> RTLVersionXXX und außerdem ebenfalls nur .0

für Delphi 11.3 :
Code:
  CompilerVersion  = 35.0;
  RTLVersion       = 35.00;
  RTLVersion111     = True;
  RTLVersion112     = True;
  RTLVersion113     = True;
  FireMonkeyVersion = 270;


Delphi-Quellcode:
//{$IF (CompilerVersion = 35) and RTLVersion113}  // 11.3  ist zwar ein Boolean, aber die Konstante existiert nicht immer -> True oder nicht existent (nie False)

{$IF (CompilerVersion = 35) and Declared(RTLVersion113)}  // 11.3
{$IF (CompilerVersion = 35) and Declared(RTLVersion112)}  // 11.2
{$IF (CompilerVersion = 35) and Declared(RTLVersion111)}  // 11.1
{$IF (CompilerVersion = 35) and not Declared(RTLVersion111)}  // 11.0
{$IF CompilerVersion = 35}  // 11.x
{$IF CompilerVersion = 34}  // 10.4
{$IF CompilerVersion = 33}  // 10.3
{$IF CompilerVersion = 32}  // 10.2
{$IF CompilerVersion = 31}  // 10.1
{$IF CompilerVersion = 30}  // 10
{$IF CompilerVersion = 29}  // XE8
{$IF CompilerVersion = 28}  // XE7
...
{$IF CompilerVersion = 22}  // XE
...
{$IF CompilerVersion = 20.0}  // 2009
{$IF CompilerVersion = 18.5}  // 2007  (2007 hatte den selben Compiler wie 2006)
{$IF CompilerVersion = 18.0}  // 2006
{$IF CompilerVersion = 17.0}  // 2005
Statt = würde ich aber besser immer nur mit <= oder >= arbeiten.
Delphi-Quellcode:
{$IF CompilerVersion = 22.0}
entspricht
Delphi-Quellcode:
{$IFDEF VER220}
,
aber meisten will man ja nicht genau diese Version wissen, sondern ob es mindestens oder maximal diese Verison ist,
bzw. ein Von-Bis ala
Delphi-Quellcode:
 {$IF (CompilerVersion >= 20) and (CompilerVersion <= 23)}
anstatt
Delphi-Quellcode:
{$IFDEF VER220}{$IFDEF VER220}{$IFDEF VER220}
ähhh
Delphi-Quellcode:
{$IF Defined(VER220) or Defined(VER220) or Defined(VER220)}

lxo 6. Apr 2023 14:46

AW: Delphi-Version ermitteln
 
Zitat:

Zitat von Uwe Raabe (Beitrag 1520738)
Delphi-Quellcode:
{$IF CompilerVersion = 35} 
  {$IF Declared(RTLVersion113)} 
    // Delphi 11.3
  {$ELSEIF Declared(RTLVersion112)} 
    // Delphi 11.2
  {$ELSEIF Declared(RTLVersion111)} 
    // Delphi 11.1
  {$ELSE} 
    // Delphi 11.0
  {$IFEND}
{$IFEND}

Ich mach es jetzt einfach so.
Vor Delphi 11 gibt es dann nichts zu sehen.
Muss ich halt für die nächsten Versionen immer pflegen.

lxo 6. Apr 2023 14:52

AW: Delphi-Version ermitteln
 
Bei Delphi 10.3 z.B. könnte ich das auch anscheinend gar nicht ermitteln oder gab es da noch was anderes?

Delphi-Quellcode:
// Delphi 11.3

  RTLVersion = 35.00;
  RTLVersion111 = True;
  RTLVersion112 = True;
  RTLVersion113 = True;
 {$HPPEMIT '#define RTLVersionC 3500'}
 {$HPPEMIT '#define RTLVersion111C'}
 {$HPPEMIT '#define RTLVersion112C'}
 {$HPPEMIT '#define RTLVersion113C'}
Delphi-Quellcode:
// Delphi 10.3.3

  RTLVersion = 33.00;
 {$HPPEMIT '#define RTLVersionC 3300'}

Uwe Raabe 6. Apr 2023 14:58

AW: Delphi-Version ermitteln
 
Delphi-Quellcode:
{$IF CompilerVersion = 34} 
  {$IF Declared(RTLVersion113)} 
    // Delphi 11.3
  {$ELSEIF Declared(RTLVersion112)} 
    // Delphi 11.2
  {$ELSEIF Declared(RTLVersion111)} 
    // Delphi 11.1
  {$ELSE} 
    // Delphi 11.0
  {$IFEND}
{$ELSEIF CompilerVersion = 33}
  {$IF Declared(RTLVersion1042)} 
    // Delphi 10.4.2
  {$ELSEIF Declared(RTLVersion1041)} 
    // Delphi 10.4.1
  {$ELSE} 
    // Delphi 10.4
  {$IFEND}
{$ELSEIF CompilerVersion = 32}
usw.
{$IFEND}


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:19 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz