Linux-Installation mit Desktop-Integration hinzugefügt

- install.sh: Automatisches Installations-Script
  • Prüft und installiert Tkinter automatisch
  • Erstellt Virtual Environment
  • Desktop-Verknüpfung im Anwendungsmenü
  • Launcher-Command: pdf-to-ics

- uninstall.sh: Saubere Deinstallation
  • Entfernt alle Dateien
  • Optional: Benutzer-Konfiguration behalten

- INSTALL.md: Technische Installations-Dokumentation
- WEITERGABE.md: Benutzerfreundliche Schnellstart-Anleitung

Die Anwendung kann jetzt als fertiges Paket weitergegeben werden!
This commit is contained in:
2026-02-23 12:13:29 +01:00
parent e11d518dad
commit 3acedcafdd
4 changed files with 510 additions and 0 deletions

178
install.sh Executable file
View File

@@ -0,0 +1,178 @@
#!/bin/bash
###############################################################################
# PDF zu ICS Konverter - Installations-Script für Linux
# Installiert die Anwendung systemweit mit Desktop-Integration
###############################################################################
set -e # Beende bei Fehlern
# Farben für bessere Ausgabe
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Installation-Pfade
INSTALL_DIR="$HOME/.local/share/pdf-to-ics"
DESKTOP_FILE="$HOME/.local/share/applications/pdf-to-ics.desktop"
BIN_DIR="$HOME/.local/bin"
LAUNCHER="$BIN_DIR/pdf-to-ics"
echo -e "${BLUE}╔═══════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ PDF zu ICS Konverter - Installations-Assistent ║${NC}"
echo -e "${BLUE}╚═══════════════════════════════════════════════════════════╝${NC}"
echo ""
# Funktion für Fortschrittsanzeige
print_step() {
echo -e "${GREEN}${NC} $1"
}
print_warning() {
echo -e "${YELLOW}${NC} $1"
}
print_error() {
echo -e "${RED}${NC} $1"
}
print_success() {
echo -e "${GREEN}${NC} $1"
}
# Prüfe Python-Installation
print_step "Prüfe Python-Installation..."
if ! command -v python3 &> /dev/null; then
print_error "Python 3 ist nicht installiert!"
echo "Bitte installieren Sie Python 3:"
echo " sudo apt install python3 python3-pip python3-venv"
exit 1
fi
PYTHON_VERSION=$(python3 --version)
print_success "Python gefunden: $PYTHON_VERSION"
# Prüfe und installiere Tkinter wenn nötig
print_step "Prüfe Tkinter-Installation..."
if ! python3 -c "import tkinter" 2>/dev/null; then
print_warning "Tkinter ist nicht installiert. Installation wird versucht..."
# Erkenne Distribution
if [ -f /etc/debian_version ]; then
echo "Debian/Ubuntu erkannt. Installiere python3-tk..."
if command -v sudo &> /dev/null; then
sudo apt-get update && sudo apt-get install -y python3-tk
else
print_error "sudo nicht verfügbar. Bitte installieren Sie python3-tk manuell:"
echo " apt-get install python3-tk"
exit 1
fi
elif [ -f /etc/fedora-release ]; then
echo "Fedora erkannt. Installiere python3-tkinter..."
sudo dnf install -y python3-tkinter
elif [ -f /etc/arch-release ]; then
echo "Arch Linux erkannt. Installiere tk..."
sudo pacman -S --noconfirm tk
else
print_warning "Distribution nicht erkannt. Bitte installieren Sie Tkinter manuell."
echo "Möchten Sie trotzdem fortfahren? (y/n)"
read -r response
if [[ ! "$response" =~ ^[Yy]$ ]]; then
exit 1
fi
fi
print_success "Tkinter installiert"
else
print_success "Tkinter ist bereits installiert"
fi
# Erstelle Installationsverzeichnis
print_step "Erstelle Installationsverzeichnis..."
mkdir -p "$INSTALL_DIR"
mkdir -p "$BIN_DIR"
mkdir -p "$(dirname "$DESKTOP_FILE")"
# Kopiere Dateien
print_step "Kopiere Anwendungsdateien..."
cp -r *.py *.md *.sh *.cmd .gitignore "$INSTALL_DIR/" 2>/dev/null || true
print_success "Dateien kopiert nach $INSTALL_DIR"
# Erstelle Python Virtual Environment
print_step "Erstelle Python-Umgebung..."
cd "$INSTALL_DIR"
python3 -m venv .venv --upgrade-deps
print_success "Virtual Environment erstellt"
# Installiere Python-Abhängigkeiten
print_step "Installiere Python-Abhängigkeiten..."
.venv/bin/pip install -q --upgrade pip
.venv/bin/pip install -q pdfplumber icalendar pypdf2 pytz
.venv/bin/pip install -q tkinterdnd2 2>/dev/null || print_warning "tkinterdnd2 optional nicht installiert (kein Problem)"
print_success "Abhängigkeiten installiert"
# Erstelle Launcher-Script
print_step "Erstelle Launcher-Script..."
cat > "$LAUNCHER" << 'EOF'
#!/bin/bash
# PDF zu ICS Konverter Launcher
INSTALL_DIR="$HOME/.local/share/pdf-to-ics"
cd "$INSTALL_DIR"
exec .venv/bin/python gui.py
EOF
chmod +x "$LAUNCHER"
print_success "Launcher erstellt: $LAUNCHER"
# Erstelle Desktop-Verknüpfung
print_step "Erstelle Desktop-Verknüpfung..."
cat > "$DESKTOP_FILE" << EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=PDF zu ICS Konverter
Comment=Konvertiere Dienstplan-PDFs zu iCalendar-Dateien
Exec=$LAUNCHER
Icon=calendar
Terminal=false
Categories=Office;Utility;
Keywords=PDF;ICS;Kalender;Dienstplan;
StartupNotify=true
EOF
chmod +x "$DESKTOP_FILE"
print_success "Desktop-Verknüpfung erstellt"
# Desktop-Datenbank aktualisieren
if command -v update-desktop-database &> /dev/null; then
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
fi
# Prüfe ob ~/.local/bin im PATH ist
if [[ ":$PATH:" != *":$BIN_DIR:"* ]]; then
print_warning "~/.local/bin ist nicht im PATH!"
echo "Fügen Sie folgende Zeile zu ~/.bashrc oder ~/.zshrc hinzu:"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
fi
# Abschluss
echo ""
echo -e "${GREEN}╔═══════════════════════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ Installation erfolgreich abgeschlossen! ║${NC}"
echo -e "${GREEN}╚═══════════════════════════════════════════════════════════╝${NC}"
echo ""
print_success "Die Anwendung wurde installiert!"
echo ""
echo "Sie können die Anwendung nun starten:"
echo ""
echo " 1. ${BLUE}Über das Anwendungsmenü${NC} (suchen Sie nach 'PDF zu ICS')"
echo " 2. ${BLUE}Über die Kommandozeile:${NC} pdf-to-ics"
echo ""
echo "Installation Details:"
echo " • Installationsverzeichnis: $INSTALL_DIR"
echo " • Launcher: $LAUNCHER"
echo " • Desktop-Verknüpfung: $DESKTOP_FILE"
echo ""
echo "Zum Deinstallieren führen Sie aus:"
echo " bash $INSTALL_DIR/uninstall.sh"
echo ""