Skip to content

Bulk asynchronous downloader for multiple file hosts

misc: update start scripts (#1959)

NTFSvolumee8ef068b568b
diff --git a/scripts/release/install_android.sh b/scripts/release/android_install.sh
similarity index 87%
rename from scripts/release/install_android.sh
rename to scripts/release/android_install.sh
index aa639d266..85462e8eb 100755
--- a/scripts/release/install_android.sh
+++ b/scripts/release/android_install.sh
@@ -7,7 +7,7 @@ pkg install rust which micro libjpeg-turbo python uv -y
ANDROID_API_LEVEL=24
export ANDROID_API_LEVEL
-uv tool install cyberdrop-dl-patched
+uv tool install --upgrade --force cyberdrop-dl-patched
uv tool update-shell
mkdir /sdcard/cyberdrop-dl
echo 'alias cyberdrop-dl="cyberdrop-dl --appdata-folder /sdcard/cyberdrop-dl"' >> ~/.bashrc
diff --git a/scripts/release/linux-macOS_install.sh b/scripts/release/linux-macOS_install.sh
new file mode 100755
index 000000000..0dcb03ebe
--- /dev/null
+++ b/scripts/release/linux-macOS_install.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+set -eu
+
+PACKAGE_VERSION=">=10.0,<11.0"
+UV_INSTALL_DIR="${UV_INSTALL_DIR:-$HOME/.local/bin}"
+export UV_NO_MODIFY_PATH="1"
+
+is_installed() {
+ command -v "$1" >/dev/null 2>&1
+}
+
+if is_installed uv; then
+ UV_BIN="uv"
+elif [ -x "$UV_INSTALL_DIR/uv" ]; then
+ UV_BIN="$UV_INSTALL_DIR/uv"
+else
+ echo "uv not found, installing..."
+ if is_installed curl; then
+ curl -LsSf https://astral.sh/uv/install.sh | sh
+ elif is_installed wget; then
+ wget -qO- https://astral.sh/uv/install.sh | sh
+ elif is_installed pip; then
+ pip install uv
+ else
+ echo "Error: Unable to install uv (curl, wget and pip not found)"
+ exit 1
+ fi
+ UV_BIN="$UV_INSTALL_DIR/uv"
+fi
+
+echo Installing / Updating cyberdrop-dl...
+"$UV_BIN" tool install -p "<3.14" --no-build --upgrade --force "cyberdrop-dl-patched${PACKAGE_VERSION}"
+"$UV_BIN" tool update-shell
diff --git a/scripts/release/linux-macOS_remove.sh b/scripts/release/linux-macOS_remove.sh
new file mode 100755
index 000000000..4f1ccc496
--- /dev/null
+++ b/scripts/release/linux-macOS_remove.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+if command -v pip >/dev/null 2>&1; then
+ pip uninstall cyberdrop-dl
+ pip uninstall cyberdrop-dl-patched
+fi
+uv tool uninstall cyberdrop-dl-patched
+uv cache clean
diff --git a/scripts/release/linux-macOS_run.sh b/scripts/release/linux-macOS_run.sh
new file mode 100755
index 000000000..da546e8bb
--- /dev/null
+++ b/scripts/release/linux-macOS_run.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo Starting cyberdrop-dl...
+cyberdrop-dl-patched
diff --git a/scripts/release/start_linux.sh b/scripts/release/start_linux.sh
deleted file mode 100755
index cac8c9367..000000000
--- a/scripts/release/start_linux.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-# User defined variables
-COMMANDLINE_ARGS=""
-AUTO_UPDATE=true
-
-# ----------------------------------------------------------
-PACKAGE_NAME="cyberdrop-dl-patched"
-PACKAGE_VERSION=">=9.0,<10.0"
-
-is_installed() {
- command -v "$1" >/dev/null 2>&1
-}
-
-if ! is_installed uv; then
- echo "uv not found, installing..."
-
- if is_installed curl; then
- curl -LsSf https://astral.sh/uv/install.sh | sh
- elif is_installed wget; then
- wget -qO- https://astral.sh/uv/install.sh | sh
- elif is_installed pip; then
- pip install uv
- else
- echo "Error: Unable to install uv (curl, wget and pip not found)"
- exit 1
- fi
-
- if [ $? -ne 0 ]; then
- echo "Error: Failed to install uv."
- exit 1
- fi
- uv tool update-shell
-fi
-
-if [ "$AUTO_UPDATE" = true ] || ! is_installed "${PACKAGE_NAME}"; then
- echo Installing / Updating ${PACKAGE_NAME}...
- uv tool install -p ">=3.12,<3.14" --no-build --upgrade "${PACKAGE_NAME}${PACKAGE_VERSION}" || exit 1
-fi
-
-echo Starting ${PACKAGE_NAME}...
-"${PACKAGE_NAME}" $COMMANDLINE_ARGS
diff --git a/scripts/release/start_macOS.command b/scripts/release/start_macOS.command
deleted file mode 100755
index 8c28d5428..000000000
--- a/scripts/release/start_macOS.command
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-# User defined variables
-COMMANDLINE_ARGS=""
-AUTO_UPDATE=true
-
-# ----------------------------------------------------------
-PACKAGE_NAME="cyberdrop-dl-patched"
-PACKAGE_VERSION=">=9.0,<10.0"
-
-is_installed() {
- command -v "$1" >/dev/null 2>&1
-}
-
-# curl is always preinstalled on macOS
-if ! is_installed uv; then
- echo "uv not found, installing..."
- curl -LsSf https://astral.sh/uv/install.sh | sh
- if [ $? -ne 0 ]; then
- echo "Error: Failed to install uv."
- exit 1
- fi
- uv tool update-shell
-fi
-
-if [ "$AUTO_UPDATE" = true ] || ! is_installed "${PACKAGE_NAME}"; then
- echo Installing / Updating ${PACKAGE_NAME}...
- uv tool install -p ">=3.12,<3.14" --no-build --upgrade "${PACKAGE_NAME}${PACKAGE_VERSION}" || exit 1
-fi
-
-echo Starting ${PACKAGE_NAME}...
-"${PACKAGE_NAME}" $COMMANDLINE_ARGS
diff --git a/scripts/release/start_windows.bat b/scripts/release/start_windows.bat
deleted file mode 100644
index 260ee468b..000000000
--- a/scripts/release/start_windows.bat
+++ /dev/null
@@ -1,56 +0,0 @@
-@echo off
-REM User defined variables
-set "COMMANDLINE_ARGS="
-set "AUTO_UPDATE=true"
-
-REM ----------------------------------------------------------
-set "PACKAGE_NAME=cyberdrop-dl-patched"
-set "PACKAGE_VERSION=>=9.0,<10.0"
-
-if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (
- echo ERROR: 32-bit Windows is not supported.
- pause
- exit /b 1
-)
-
-where uv >nul 2>&1
-if errorlevel 1 (
- echo uv not found, installing...
- powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- if errorlevel 1 (
- echo Error: Failed to install uv.
- pause
- exit /b 1
- )
- uv tool update-shell
-)
-
-set "PACKAGE_INSTALLED=false"
-where %PACKAGE_NAME% >nul 2>&1
-if %errorlevel%==0 (
- set "PACKAGE_INSTALLED=true"
-)
-
-if "%AUTO_UPDATE%"=="true" (
- goto :INSTALL_OR_UPDATE
-)
-
-if "%PACKAGE_INSTALLED%"=="false" (
- goto :INSTALL_OR_UPDATE
-)
-goto :RUN
-
-:INSTALL_OR_UPDATE
-echo Installing / Updating %PACKAGE_NAME%...
-pip uninstall cyberdrop-dl -qq >nul 2>&1
-uv tool install --managed-python -p ">=3.12,<3.14" --no-build --upgrade "%PACKAGE_NAME%%PACKAGE_VERSION%"
-if errorlevel 1 (
- echo Error: Failed to install %PACKAGE_NAME%.
- pause
- exit /b 1
-)
-
-:RUN
-echo Starting %PACKAGE_NAME%...
-%PACKAGE_NAME% %COMMANDLINE_ARGS%
-pause
diff --git a/scripts/release/windows_install.bat b/scripts/release/windows_install.bat
new file mode 100644
index 000000000..f7d997e06
--- /dev/null
+++ b/scripts/release/windows_install.bat
@@ -0,0 +1,52 @@
+@echo off
+setlocal EnableDelayedExpansion
+set "errorlevel="
+set "PACKAGE_VERSION=>=10.0,<11.0"
+set "UV_NO_MODIFY_PATH=1"
+
+if defined UV_INSTALL_DIR (
+ set "uv_dir=%UV_INSTALL_DIR%"
+) else (
+ set "uv_dir=%USERPROFILE%\.local\bin"
+)
+
+set "uv_bin="
+where uv >nul 2>&1
+if %errorlevel%==0 (
+ set "uv_bin=uv"
+ goto :found
+)
+
+if exist "%uv_dir%\uv.exe" (
+ set "uv_bin=%uv_dir%\uv.exe"
+ goto :found
+)
+
+if exist "%APPDATA%\uv\uv.exe" (
+ set "uv_bin=%APPDATA%\uv\uv.exe"
+ goto :found
+)
+
+echo uv not found, installing...
+powershell -NoProfile -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
+
+if exist "%uv_dir%\uv.exe" (
+ set "uv_bin=%uv_dir%\uv.exe"
+ goto :found
+)
+
+if exist "%APPDATA%\uv\uv.exe" (
+ set "uv_bin=%APPDATA%\uv\uv.exe"
+ goto :found
+)
+
+echo ERROR: Unable to find uv after installation.
+pause
+exit /b 1
+
+:found
+echo Installing / Updating cyberdrop-dl...
+"%uv_bin%" tool install --managed-python -p "<3.14" --no-build --upgrade --force "cyberdrop-dl-patched%PACKAGE_VERSION%"
+"%uv_bin%" tool update-shell
+endlocal
+pause
diff --git a/scripts/release/windows_remove.bat b/scripts/release/windows_remove.bat
new file mode 100644
index 000000000..773cbc662
--- /dev/null
+++ b/scripts/release/windows_remove.bat
@@ -0,0 +1,9 @@
+@echo off
+where pip >nul 2>&1
+if %errorlevel%==0 (
+ pip uninstall cyberdrop-dl
+ pip uninstall cyberdrop-dl-patched
+)
+uv tool uninstall cyberdrop-dl-patched
+uv cache clean
+pause
diff --git a/scripts/release/windows_run.bat b/scripts/release/windows_run.bat
new file mode 100644
index 000000000..0fa3209a1
--- /dev/null
+++ b/scripts/release/windows_run.bat
@@ -0,0 +1,4 @@
+@echo off
+echo Starting cyberdrop-dl...
+cyberdrop-dl-patched
+pause