|
2 | 2 | # |
3 | 3 | # Single step download and execute with the following: |
4 | 4 | # curl -fsSL https://tinyurl.com/SetupLinux4Delphi | sudo bash |
| 5 | +# or |
| 6 | +# wget -q -O https://tinyurl.com/SetupLinux4Delphi | sudo bash |
5 | 7 | # |
6 | 8 | echo "_____________________________________________________________" |
7 | 9 | echo "" |
8 | | -echo "Setup Linux for Delphi development version 2025-12-16.6" |
| 10 | +echo "Setup Linux for Delphi development version 2025-12-19" |
9 | 11 | echo "_____________________________________________________________" |
10 | 12 | echo "" |
11 | | -echo "This script requires sudo privileges and curl." |
12 | | -echo "More info: https://github.com/jimmckeeth/Delphi-on-Linux-Setup" |
| 13 | +echo "This script requires sudo privileges" |
| 14 | +echo "More info: https://github.com/jimmckeeth/Linux4Delphi" |
13 | 15 | echo "" |
14 | 16 | # Stop on all errors |
15 | 17 | set -e |
|
23 | 25 | PARAM="37.0" # Default version |
24 | 26 | PKG_OVERRIDE="" |
25 | 27 |
|
| 28 | +# Function to download files using whichever tool is available |
| 29 | +download_file() { |
| 30 | + local url=$1 |
| 31 | + local dest=$2 |
| 32 | + if command -v wget >/dev/null 2>&1; then |
| 33 | + wget -q -O "$dest" "$url" |
| 34 | + elif command -v curl >/dev/null 2>&1; then |
| 35 | + curl -fsSL -o "$dest" "$url" |
| 36 | + else |
| 37 | + echo "❌ Error: Neither wget nor curl found. Please install one to continue." |
| 38 | + exit 1 |
| 39 | + fi |
| 40 | +} |
| 41 | + |
26 | 42 | while [[ $# -gt 0 ]]; do |
27 | 43 | key="$(echo "$1" | tr '[:upper:]' '[:lower:]')" |
28 | 44 | case $key in |
@@ -374,8 +390,8 @@ if ! mkdir -p "$INSTALL_DIR"; then |
374 | 390 | fi |
375 | 391 | echo "__________________________________________________________________" |
376 | 392 | echo "" |
377 | | -echo "Downloading Linux PAServer " |
378 | | -wget -O "$INSTALL_DIR/$ARCHIVE" "$PASERVER_URL" |
| 393 | +echo "Downloading Linux PAServer" |
| 394 | +download_file "$PASERVER_URL" "$INSTALL_DIR/$ARCHIVE" |
379 | 395 | echo "__________________________________________________________________" |
380 | 396 | echo "" |
381 | 397 | if ! tar xvf "$INSTALL_DIR/$ARCHIVE" -C "$INSTALL_DIR" --strip-components=1; then |
@@ -420,7 +436,7 @@ echo "" |
420 | 436 | echo "Install dir: $INSTALL_DIR " |
421 | 437 | echo "Script path: $SCRIPT_PATH " |
422 | 438 | echo "Scratch dir: $SCRATCH_DIR " |
423 | | -echo "Password is BLANK (none) " |
| 439 | +echo "Password is BLANK (none) so you might want to change that..." |
424 | 440 | echo "________________________________________" |
425 | 441 | echo "" |
426 | 442 | # https://docwiki.embarcadero.com/RADStudio/en/Setting_Options_for_the_Platform_Assistant |
|
0 commit comments