-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-script.sh
139 lines (121 loc) · 3.74 KB
/
install-script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
# Text colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to print colored messages
print_status() {
echo -e "${GREEN}[+]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[!]${NC} $1"
}
print_error() {
echo -e "${RED}[-]${NC} $1"
}
# Check if script is run as root
if [ "$EUID" -ne 0 ]; then
print_error "Please run this script as root (use sudo)"
exit 1
fi
# Detect package manager
if command -v apt-get >/dev/null 2>&1; then
PKG_MANAGER="apt-get"
print_status "Detected Debian/Ubuntu based system"
# Update package lists
print_status "Updating package lists..."
apt-get update
# Install Qt dependencies
apt-get install -y qt6-base-dev libqt6core6 libqt6gui6 libqt6widgets6
elif command -v dnf >/dev/null 2>&1; then
PKG_MANAGER="dnf"
print_status "Detected Fedora/RHEL based system"
# Install Qt dependencies
dnf install -y qt6-qtbase-devel
elif command -v pacman >/dev/null 2>&1; then
PKG_MANAGER="pacman"
print_status "Detected Arch Linux based system"
# Update package lists
print_status "Updating package lists..."
pacman -Sy
# Install Qt dependencies
pacman -S --noconfirm qt6-base
else
print_error "Unsupported package manager. Please install dependencies manually."
exit 1
fi
# Install system dependencies based on package manager
print_status "Installing system dependencies..."
case $PKG_MANAGER in
"apt-get")
apt-get install -y python3 python3-pip python3-venv libexif-dev exiftool wget curl \
libmagic-dev libtiff5-dev libjpeg-dev libopenjp2-7-dev libwebp-dev python3-tk
;;
"dnf")
dnf install -y python3 python3-pip python3-devel perl-Image-ExifTool wget curl \
file-devel libtiff-devel libjpeg-devel openjpeg2-devel libwebp-devel python3-tkinter
;;
"pacman")
pacman -S --noconfirm python python-pip perl-image-exiftool wget curl \
file libtiff libjpeg-turbo openjpeg2 libwebp tk
;;
esac
if [ $? -ne 0 ]; then
print_error "Failed to install system dependencies"
exit 1
fi
# Create and activate virtual environment
print_status "Setting up Python virtual environment..."
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
print_status "Installing Python dependencies..."
pip install --upgrade pip
# Install required Python packages
print_status "Installing Python packages..."
pip install \
requests \
beautifulsoup4 \
pillow \
python-magic \
python-docx \
PyPDF2 \
PyQt6 \
urllib3 \
mimetypes \
datetime \
hashlib \
zipfile \
struct \
tqdm \
colorama
if [ $? -ne 0 ]; then
print_error "Failed to install Python packages"
exit 1
fi
# Create necessary directories
print_status "Creating necessary directories..."
mkdir -p downloads
mkdir -p results
mkdir -p temp
# Set correct permissions
print_status "Setting correct permissions..."
chmod +x MetaSpidey.py
chown -R $SUDO_USER:$SUDO_USER .
print_status "Installation completed successfully!"
echo
print_warning "To use MetaSpidey:"
echo "1. Activate the virtual environment: source venv/bin/activate"
echo "2. Run the program: python3 MetaSpidey.py"
echo
print_warning "Note: Some packages like 'hashlib', 'mimetypes', 'datetime', 'struct', and 'os' are part of Python's standard library and don't need separate installation."
print_warning "Make sure your system has Qt6 properly configured for the GUI to work."
# Test GUI capability
print_status "Testing Qt6 installation..."
python3 -c "from PyQt6.QtWidgets import QApplication" 2>/dev/null
if [ $? -eq 0 ]; then
print_status "Qt6 installation verified successfully"
else
print_warning "Qt6 installation might need manual configuration"
fi