installer offline

This commit is contained in:
2025-09-10 16:19:43 +03:00
parent b6e6190d6c
commit 35db99eb3d
6 changed files with 26 additions and 157 deletions

0
install_minimal_xorg.sh Normal file
View File

View File

@@ -1,187 +1,56 @@
#!/bin/bash #!/bin/bash
# Offline Installation Script for Tkinter Player # Simple Offline Installation Script for Tkinter Player
# Auto-detects architecture and uses appropriate local libraries ONLY
set -e set -e
echo "===================================" echo "================================="
echo " TKINTER PLAYER OFFLINE INSTALLER" echo " TKINTER PLAYER OFFLINE INSTALL"
echo "===================================" echo "================================="
echo ""
# Detect system architecture # 1. Check architecture
ARCH=$(uname -m) ARCH=$(uname -m)
echo "🔍 Detected architecture: $ARCH" echo "Architecture: $ARCH"
# Determine which library folder to use based on architecture # 2. Select library folder
if [ "$ARCH" = "armv7l" ]; then if [ "$ARCH" = "armv7l" ]; then
LIBS_FOLDER="req_libraries_32bit" LIBS_FOLDER="req_libraries_32bit"
ARCH_DESC="32-bit ARM (armv7l)" echo "Using: 32-bit libraries"
echo "📦 32-bit ARM system detected"
elif [ "$ARCH" = "aarch64" ]; then elif [ "$ARCH" = "aarch64" ]; then
LIBS_FOLDER="req_libraries" LIBS_FOLDER="req_libraries"
ARCH_DESC="64-bit ARM (aarch64)" echo "Using: 64-bit libraries"
echo "📦 64-bit ARM system detected"
else else
echo "⚠️ Unknown architecture: $ARCH"
echo " Defaulting to 64-bit libraries..."
LIBS_FOLDER="req_libraries" LIBS_FOLDER="req_libraries"
ARCH_DESC="Unknown ($ARCH) - using 64-bit fallback" echo "Using: default libraries"
fi fi
echo "<EFBFBD> Selected library folder: $LIBS_FOLDER" # 3. Check folder exists
echo "🏗️ Architecture: $ARCH_DESC"
echo ""
# Check if the selected library folder exists
if [ ! -d "$LIBS_FOLDER" ]; then if [ ! -d "$LIBS_FOLDER" ]; then
echo "ERROR: Required library folder not found!" echo "ERROR: $LIBS_FOLDER not found!"
echo " Missing folder: $LIBS_FOLDER"
echo ""
if [ "$ARCH" = "armv7l" ]; then
echo "💡 For 32-bit ARM systems:"
echo " 1. Run: ./download_32bit_libs.sh"
echo " 2. Make sure req_libraries_32bit/ folder exists"
else
echo "💡 For 64-bit ARM systems:"
echo " 1. Make sure req_libraries/ folder exists"
echo " 2. Run: pip download -r requirements.txt -d req_libraries/"
fi
echo ""
exit 1 exit 1
fi fi
# Verify we have wheel files in the selected folder echo "Library folder: $LIBS_FOLDER"
WHEEL_COUNT=$(ls $LIBS_FOLDER/*.whl 2>/dev/null | wc -l) WHEEL_COUNT=$(ls $LIBS_FOLDER/*.whl | wc -l)
if [ "$WHEEL_COUNT" -eq 0 ]; then echo "Wheel files: $WHEEL_COUNT"
echo "❌ ERROR: No wheel files found in $LIBS_FOLDER/"
echo " Please download the appropriate libraries first."
exit 1
fi
echo "✅ Found $WHEEL_COUNT wheel files in $LIBS_FOLDER/" # 4. Create .venv
# Check Python and pip
if ! command -v python3 &> /dev/null; then
echo "❌ Error: Python 3 is not installed!"
exit 1
fi
PIP_CMD="pip3"
if ! command -v pip3 &> /dev/null; then
PIP_CMD="pip"
fi
echo "<22><> Environment check:"
echo " Python: $(python3 --version)"
echo " Architecture: $ARCH_DESC"
# Count wheel files
WHEEL_COUNT=$(ls $LIBS_FOLDER/*.whl 2>/dev/null | wc -l)
echo " Wheel files: $WHEEL_COUNT in $LIBS_FOLDER/"
# Show architecture-specific packages for verification
echo "" echo ""
echo "🔍 Architecture-specific packages detected:" echo "Creating .venv..."
if ls $LIBS_FOLDER/bcrypt*.whl >/dev/null 2>&1; then
BCRYPT_FILE=$(basename $(ls $LIBS_FOLDER/bcrypt*.whl | head -1))
echo " 🔐 BCRYPT: $BCRYPT_FILE"
# Show if it's 32-bit or 64-bit specific
if [[ "$BCRYPT_FILE" == *"armv7l"* ]]; then
echo " → 32-bit ARM wheel ✅"
elif [[ "$BCRYPT_FILE" == *"aarch64"* ]]; then
echo " → 64-bit ARM wheel ✅"
fi
fi
if ls $LIBS_FOLDER/pillow*.whl >/dev/null 2>&1; then
PILLOW_FILE=$(basename $(ls $LIBS_FOLDER/pillow*.whl | head -1))
echo " 🖼️ PILLOW: $PILLOW_FILE"
if [[ "$PILLOW_FILE" == *"armv7l"* ]]; then
echo " → 32-bit ARM wheel ✅"
elif [[ "$PILLOW_FILE" == *"aarch64"* ]]; then
echo " → 64-bit ARM wheel ✅"
fi
fi
if ls $LIBS_FOLDER/psutil*.whl >/dev/null 2>&1; then
PSUTIL_FILE=$(basename $(ls $LIBS_FOLDER/psutil*.whl | head -1))
echo " 📊 PSUTIL: $PSUTIL_FILE"
if [[ "$PSUTIL_FILE" == *"armv7l"* ]]; then
echo " → 32-bit ARM wheel ✅"
elif [[ "$PSUTIL_FILE" == *"aarch64"* ]]; then
echo " → 64-bit ARM wheel ✅"
fi
fi
echo ""
# Ask for confirmation
read -p "🚀 Ready to install? (y/N): " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Installation cancelled."
exit 1
fi
# Create and activate virtual environment
if [ ! -d ".venv" ]; then
echo "📁 Creating virtual environment..."
python3 -m venv .venv python3 -m venv .venv
fi
echo "🔄 Activating virtual environment..." # 5. Activate environment
echo "Activating environment..."
source .venv/bin/activate source .venv/bin/activate
pip install --upgrade pip
# Install packages COMPLETELY OFFLINE # 6. Upgrade pip
echo "" #echo "Upgrading pip..."
echo "📦 Installing packages from $LIBS_FOLDER/ (OFFLINE ONLY)..." #pip install --upgrade pip
echo "============================================================"
echo "🚫 Internet access: DISABLED for this installation"
echo "📁 Source: Local wheel files only"
echo ""
# Force completely offline installation - no internet access allowed # 7. Install packages offline
echo "🔧 Installing architecture-specific wheels..." echo ""
echo "Installing from $LIBS_FOLDER..."
pip install --no-index --no-deps --find-links $LIBS_FOLDER/ $LIBS_FOLDER/*.whl pip install --no-index --no-deps --find-links $LIBS_FOLDER/ $LIBS_FOLDER/*.whl
echo ""
echo "🔍 Verifying architecture-specific installation..."
# Test key imports to verify correct architecture packages were installed
python3 -c "
import sys
print(f'✅ Python version: {sys.version}')
print(f'✅ Platform: {sys.platform}')
try:
import requests
print('✅ requests - Network library installed')
except ImportError as e:
print(f'❌ requests failed: {e}')
try:
import bcrypt
print('✅ bcrypt - Encryption library installed')
except ImportError as e:
print(f'❌ bcrypt failed: {e}')
try:
import vlc
print('✅ python-vlc - Media library installed')
except ImportError as e:
print(f'❌ python-vlc failed: {e}')
try:
import PIL
print('✅ Pillow - Image library installed')
except ImportError as e:
print(f'❌ Pillow failed: {e}')
try:
import psutil
print('✅ psutil - System library installed')
except ImportError as e:
print(f'❌ psutil failed: {e}')
"
echo "" echo ""
echo "✅ Installation completed!" echo "✅ Installation completed!"
echo "" echo ""

0
test_complete_offline.py Normal file
View File

0
test_feedback.py Normal file
View File

0
test_offline.py Normal file
View File

0
test_ui_notification.py Normal file
View File