| 1 | # Asynchronous download |
| 2 | |
| 3 | Demonstrates using `TCastleDownload` to download files asynchronously, i.e. without blocking the main application while it waits for the download to finish. |
| 4 | |
| 5 | Using [Castle Game Engine](https://castle-engine.io/). |
| 6 | |
| 7 |  |
| 8 | |
| 9 | ## On Windows, make sure to use OpenSSL DLLs to have HTTPS support |
| 10 | |
| 11 | Both FPC and Delphi code paths use OpenSSL to implement HTTPS support. |
| 12 | |
| 13 | We strongly advise to compile at least once using [CGE editor](https://castle-engine.io/editor) that will place the appropriate DLLs automatically alongside your EXE. Afterwards you can build using [CGE editor](https://castle-engine.io/editor) or from Delphi or Lazarus IDEs, the DLLs will be in place. |
| 14 | |
| 15 | If you really must do it manually, get the 2 necessary DLLs from these locations: |
| 16 | |
| 17 | - Win64: https://github.com/castle-engine/castle-engine/tree/master/tools/build-tool/data/external_libraries/x86_64-win64/openssl |
| 18 | |
| 19 | - Win32: https://github.com/castle-engine/castle-engine/tree/master/tools/build-tool/data/external_libraries/i386-win32/openssl |
| 20 | |
| 21 | ## FPC + HTTPS + Linux |
| 22 | |
| 23 | If you use FPC on Linux, note that older FPC (including 3.2.2) does not handle latest OpenSSL library versions. |
| 24 | |
| 25 | If you get errors related to OpenSSL, upgrade to latest FPC (from GitLab) e.g. using [fpcupdeluxe](https://castle-engine.io/fpcupdeluxe). |
| 26 | |
| 27 | ## Building |
| 28 | |
| 29 | Compile by: |
| 30 | |
| 31 | - [CGE editor](https://castle-engine.io/editor). Just use menu items _"Compile"_ or _"Compile And Run"_. |
| 32 | |
| 33 | - Or use [CGE command-line build tool](https://castle-engine.io/build_tool). Run `castle-engine compile` in this directory. |
| 34 | |
| 35 | - Or use [Lazarus](https://www.lazarus-ide.org/). Open in Lazarus `remote_logging_standalone.lpi` file and compile / run from Lazarus. Make sure to first register [CGE Lazarus packages](https://castle-engine.io/lazarus). |