create installer

This commit is contained in:
2025-09-10 15:43:14 +03:00
parent 26a9db889f
commit b6e6190d6c
41 changed files with 308 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
# Multi-Architecture Offline Installation Guide
## Overview
The enhanced `install_offline.sh` script automatically detects your system architecture and uses the appropriate libraries.
## Architecture Support
### 64-bit ARM (aarch64) - Raspberry Pi 4/5 with 64-bit OS
- **Folder used**: `req_libraries/`
- **Files**: 18 wheel files
- **Key packages**:
- bcrypt-4.3.0-cp39-abi3-manylinux_2_34_aarch64.whl
- pillow-11.3.0-cp311-cp311-manylinux_2_27_aarch64.whl
- psutil-7.0.0-cp36-abi3-manylinux_2_17_aarch64.whl
### 32-bit ARM (armv7l) - Raspberry Pi with 32-bit OS
- **Folder used**: `req_libraries_32bit/`
- **Files**: 18 wheel files
- **Key packages**:
- bcrypt-4.3.0-cp311-cp311-linux_armv7l.whl
- pillow-11.3.0-cp311-cp311-linux_armv7l.whl
- psutil-6.0.0-cp311-abi3-linux_armv7l.whl
## Usage
### Simple Installation (Auto-Detect)
```bash
./install_offline.sh
```
The script will:
1. Detect your architecture automatically
2. Choose the correct library folder
3. Install the appropriate packages
4. Create a virtual environment
5. Verify installation
### Manual Architecture Check
```bash
uname -m
```
- `aarch64` = 64-bit (uses req_libraries/)
- `armv7l` = 32-bit (uses req_libraries_32bit/)
## Folder Structure
```
tkinter_player/
├── req_libraries/ # 64-bit ARM wheels
├── req_libraries_32bit/ # 32-bit ARM wheels
├── install_offline.sh # Auto-detecting installer
└── requirements.txt # Package list
```
## Benefits
- ✅ Single installer for both architectures
- ✅ Automatic architecture detection
- ✅ No manual intervention needed
- ✅ Proper error messages for missing libraries
- ✅ Complete offline installation support

44
OFFLINE_INSTALL_README.md Normal file
View File

@@ -0,0 +1,44 @@
# Offline Installation Guide
## Architecture Compatibility
### Current Libraries (req_libraries/)
- Compatible with: 64-bit Raspberry Pi OS (aarch64)
- NOT compatible with: 32-bit Raspberry Pi OS (armv7l)
### For 32-bit Raspberry Pi OS
The current wheels contain aarch64 packages that won't work on 32-bit systems.
## Installation Options
### 64-bit Raspberry Pi OS:
```bash
./install_offline.sh
```
### 32-bit Raspberry Pi OS:
1. Run on internet-connected system: `./download_32bit_libs.sh`
2. Copy req_libraries_32bit/ to offline system
3. Rename: `mv req_libraries_32bit req_libraries`
4. Run: `./install_offline.sh`
## System Requirements
### 32-bit systems need build tools:
```bash
sudo apt update
sudo apt install build-essential python3-dev python3-pip
```
### All systems need VLC:
```bash
sudo apt install vlc
```
## Quick Check
```bash
uname -m
```
- aarch64 = 64-bit (current wheels work)
- armv7l = 32-bit (need different wheels)

15
download_32bit_libs.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Download 32-bit ARM compatible libraries
set -e
echo "Downloading 32-bit ARM compatible packages..."
# Create directory for 32-bit wheels
mkdir -p req_libraries_32bit
# Download with broader compatibility
pip download -r requirements.txt -d req_libraries_32bit/ --prefer-binary
echo "Download completed!"
echo "Files downloaded to req_libraries_32bit/"

View File

190
install_offline.sh Executable file
View File

@@ -0,0 +1,190 @@
#!/bin/bash
# Offline Installation Script for Tkinter Player
# Auto-detects architecture and uses appropriate local libraries ONLY
set -e
echo "==================================="
echo " TKINTER PLAYER OFFLINE INSTALLER"
echo "==================================="
echo ""
# Detect system architecture
ARCH=$(uname -m)
echo "🔍 Detected architecture: $ARCH"
# Determine which library folder to use based on architecture
if [ "$ARCH" = "armv7l" ]; then
LIBS_FOLDER="req_libraries_32bit"
ARCH_DESC="32-bit ARM (armv7l)"
echo "📦 32-bit ARM system detected"
elif [ "$ARCH" = "aarch64" ]; then
LIBS_FOLDER="req_libraries"
ARCH_DESC="64-bit ARM (aarch64)"
echo "📦 64-bit ARM system detected"
else
echo "⚠️ Unknown architecture: $ARCH"
echo " Defaulting to 64-bit libraries..."
LIBS_FOLDER="req_libraries"
ARCH_DESC="Unknown ($ARCH) - using 64-bit fallback"
fi
echo "<EFBFBD> Selected library folder: $LIBS_FOLDER"
echo "🏗️ Architecture: $ARCH_DESC"
echo ""
# Check if the selected library folder exists
if [ ! -d "$LIBS_FOLDER" ]; then
echo "❌ ERROR: Required library 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
fi
# Verify we have wheel files in the selected folder
WHEEL_COUNT=$(ls $LIBS_FOLDER/*.whl 2>/dev/null | wc -l)
if [ "$WHEEL_COUNT" -eq 0 ]; then
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/"
# 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 "🔍 Architecture-specific packages detected:"
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
fi
echo "🔄 Activating virtual environment..."
source .venv/bin/activate
pip install --upgrade pip
# Install packages COMPLETELY OFFLINE
echo ""
echo "📦 Installing packages from $LIBS_FOLDER/ (OFFLINE ONLY)..."
echo "============================================================"
echo "🚫 Internet access: DISABLED for this installation"
echo "📁 Source: Local wheel files only"
echo ""
# Force completely offline installation - no internet access allowed
echo "🔧 Installing architecture-specific wheels..."
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 "✅ Installation completed!"
echo ""
echo "Next steps:"
echo "1. source .venv/bin/activate"
echo "2. ./run_app.sh"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.