Fix win \ unix installer

This commit is contained in:
Lovi 2024-12-30 11:40:22 +01:00
parent e7f40d89ca
commit 288976bfcb
3 changed files with 11 additions and 106 deletions

View File

@ -1,8 +1,5 @@
#!/bin/sh
# Spostarsi nella directory superiore rispetto a quella corrente
cd "$(dirname "$0")/.." || exit 1
# Function to check if a command exists
command_exists() {
command -v "$1" > /dev/null 2>&1
@ -47,35 +44,6 @@ install_on_macos() {
set -e
# Check and install Python3
# if command_exists python3 > /dev/null 2>&1; then
# echo "Checking Python..."
# else
# # Detect the platform and install Python3 accordingly
# if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# # Detect the package manager
# if command_exists apt; then
# install_on_debian "python3"
# elif command_exists yum; then
# install_on_redhat "python3"
# elif command_exists pacman; then
# install_on_arch "python-pip"
# else
# echo "Unsupported Linux distribution."
# exit 1
# fi
# elif [[ "$OSTYPE" == "bsd"* ]]; then
# echo "Detected BSD-based system."
# install_on_bsd "python39"
# elif [[ "$OSTYPE" == "darwin"* ]]; then
# install_on_macos "python"
# else
# echo "Unsupported operating system."
# exit 1
# fi
# fi
# Get the Python version
PYTHON_VERSION=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
@ -154,50 +122,7 @@ else
esac
fi
if command_exists openssl || .venv/bin/pip list | grep -q pycryptodome; then
echo "openssl or pycryptodome exists."
else
echo "Please choose an option:"
echo "1) openssl"
echo "2) pycryptodome"
read -p "Enter your choice (1): " choice
case "$choice" in
2)
echo "Installing pycryptodome."
.venv/bin/pip install pycryptodome
;;
*)
# Detect the platform and install OpenSSL accordingly.
case "$(uname)" in
Linux)
if command_exists apt; then
install_on_debian openssl
elif command_exists yum; then
install_on_redhat openssl
elif command_exists pacman; then
install_on_arch openssl
else
echo "Unsupported Linux distribution."
exit 1
fi
;;
FreeBSD|NetBSD|OpenBSD)
install_on_bsd openssl
;;
Darwin)
install_on_macos openssl
;;
*)
echo "Unsupported operating system."
exit 1
;;
esac
;;
esac
fi
sed -i.bak '1s|.*|#!.venv/bin/python3|' test_run.py
sudo chmod +x test_run.py
echo 'Everything is installed!'
echo 'Run StreamingCommunity with "./test_run.py"'
echo 'Run StreamingCommunity with "./test_run.py"'

View File

@ -33,6 +33,9 @@ IF %ERRORLEVEL% EQU 0 (
echo Chocolatey installed successfully.
call choco --version
echo.
echo Please restart the terminal to continue...
pause
exit /b
)
:: Check if Python is already installed
@ -41,7 +44,7 @@ echo Checking if Python is installed...
python -V >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
echo Python is already installed. Skipping installation.
goto install_openssl
goto install_ffmpeg
) ELSE (
echo Installing Python...
choco install python --confirm --params="'/NoStore'" --allow-downgrade || (
@ -51,29 +54,9 @@ IF %ERRORLEVEL% EQU 0 (
echo Python installed successfully.
call python -V
echo.
)
:: Ask to restart the terminal
echo Please restart the terminal to continue...
pause
exit /b
:: Check if OpenSSL is already installed
:install_openssl
echo Checking if OpenSSL is installed...
openssl version -a >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
echo OpenSSL is already installed. Skipping installation.
goto install_ffmpeg
) ELSE (
echo Installing OpenSSL...
choco install openssl --confirm || (
echo Error during OpenSSL installation.
exit /b 1
)
echo OpenSSL installed successfully.
call openssl version -a
echo.
echo Please restart the terminal to continue...
pause
exit /b
)
:: Check if FFmpeg is already installed
@ -99,7 +82,6 @@ IF %ERRORLEVEL% EQU 0 (
echo Verifying installations...
call choco --version
call python -V
call openssl version -a
call ffmpeg -version
echo All programs have been successfully installed and verified.
@ -126,7 +108,7 @@ pip install -r requirements.txt || (
exit /b 1
)
:: Run run.py
:: Run test_run.py
echo Running test_run.py...
call .venv\Scripts\python .\test_run.py || (
echo Error during run.py execution.
@ -135,4 +117,4 @@ call .venv\Scripts\python .\test_run.py || (
echo End of script.
ENDLOCAL
ENDLOCAL

View File

@ -331,10 +331,8 @@ forced-ita hin - Hindi pol - Polish tur - Turkish
<br>
# COMMAND
- Download a specific season by entering its number.
* **Example:** `1` will download *Season 1* only.
@ -405,7 +403,7 @@ The `run-container` command mounts also the `config.json` file, so any change to
# To Do
- Create website API -> https://github.com/Lovi-0/StreamingCommunity/tree/test_gui_1
- Finish [website API](https://github.com/Lovi-0/StreamingCommunity/tree/test_gui_1)
# Contributing