<p>Is there a way in Delphi to get the currect application's exe size in one or two lines of code?</p>

Unfortunatly it is not possible to do that with only one or two lines of code without using some library.
The easy part is getting the application's exe file. You can find it in
```
Application.ExeName
```
In general there are several possibilities for retrieving the file size:
Open the file and read the size of the stream. This can be accomplished using the 'old' Delphi functions
```
FileOpen
```
and
```
FileSize
```
, or with
```
TFileStream
```
(use the
```
size
```
property) or with Win32 API functions
```
CreateFile
```
and
```
GetFileSize
```
function. (Platform dependend!) Make sure you open the file with read-only access.
In a pure Win32 envinronment you can use
```
FindFirst
```
to get the file size. You can read it from
```
TSearchRec.FindData.nFileSizeLow
```
. If you want to be prepared for files larger than 2 GB (you should be) you have to use also the
```
nFileSizeHigh
```
part.
In Delphi.NET you can use the
```
System.IO.FileInfo
```
, like this:
```
FileInfo.Create(filename).Length
```
(one-liner)
In Linux you can use the
```
lstat64
```
function (Unit
```
Libc
```
) and get the size from
```
TStatBuf64.st_size
```
.  (two-liner if you don't count the variable declaration)
In the
JCL library
you can find many useful functions, including a simple function which returns the file size of a given file name. (It uses a method which suits the given platform)