How to get Indy version using Indy component at runtime?
As @Remy noted in his comment, you can get the Indy version from any Indy component using the Version property. Here's a sample using the TIdHTTP component:
procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage('Indy version: ' + IdHTTP1.Version); end;
How to get Indy version without Indy component at runtime?
You can get the entire version string in Indy version format:
<major>.<minor>.<release>.<build>
from the gsIdVersion constant defined in the IdVers.inc file included in the IdGlobal.pas block, as follows:
uses IdGlobal; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage('Indy version: ' + gsIdVersion); end;
or if you have revised Indy since at least October 25, 2012 (4850), you can use separate version information elements that are defined in the same include file as mentioned earlier, for example, as follows:
uses IdGlobal; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage('Indy version: ' + IntToStr(gsIdVersionMajor) + '.' + IntToStr(gsIdVersionMinor) + '.' + IntToStr(gsIdVersionRelease) + '.' + IntToStr(gsIdVersionBuild) ); end;
How to get Indy version during development?
To get the Indy version at design time, you can simply right-click any of the Indy components that are reset to the form and open its About menu item About Internet Direct (Indy)...
Where is version information determined?
As I mentioned earlier, it is located in the IdVers.inc include file, which is stored in the ..\Lib\System\ library folder, and this may be the next option to get Indy version information.
Renouncement
Some of what was mentioned here refers to the latest version of Indy at the moment, but I'm not sure if it applies to all older versions (like Indy 9, for example).