You need to sign in or sign up before continuing.

Add Visual Progress Bar to Auto-Installer

 ENHANCED AUTO-INSTALLER with Visual Progress:
- Added zenity for graphical progress dialogs
- Added dialog fallback for text-based progress
- 8-step installation process with clear progress tracking
- Real-time progress updates during installation
- Professional completion dialog

TECHNICAL DETAILS:
+ zenity package added for GUI progress bars
+ Progress tracking functions in auto-installer.sh
+ Visual feedback for all installation steps
+ Enhanced cleanup.sh to remove PyInstaller artifacts

USER EXPERIENCE:
- Live CD shows professional progress bar during installation
- Clear step-by-step progress indication
- Completion notification before reboot
- Fallback to text mode if GUI unavailable
parent 6067043b
......@@ -89,7 +89,52 @@ if [ -d "chroot" ]; then
fi
fi
# Clean PyInstaller artifacts from USB creator tool
echo "Cleaning PyInstaller artifacts..."
# Remove PyInstaller build outputs
if [ -d "dist" ]; then
rm -rf dist
echo "Removed dist/ directory"
fi
if [ -d "build" ]; then
rm -rf build
echo "Removed build/ directory"
fi
# Remove PyInstaller spec files (auto-generated)
for spec_file in *.spec; do
if [ -f "$spec_file" ]; then
rm "$spec_file"
echo "Removed PyInstaller spec file: $spec_file"
fi
done
# Remove Python cache directories
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete 2>/dev/null || true
find . -name "*.pyo" -delete 2>/dev/null || true
# Remove Python egg-info directories
for egg_dir in *.egg-info; do
if [ -d "$egg_dir" ]; then
rm -rf "$egg_dir"
echo "Removed Python egg-info: $egg_dir"
fi
done
# Remove any temporary PyInstaller directories
for temp_dir in /tmp/pyinstaller_*; do
if [ -d "$temp_dir" ]; then
rm -rf "$temp_dir" 2>/dev/null || true
fi
done
echo "PyInstaller cleanup completed"
# Clean live-build cache and temporary files
lb clean
echo "Cleanup completed. Configuration reset to defaults."
\ No newline at end of file
echo "Cleanup completed. Configuration reset to defaults."
echo "All build artifacts and PyInstaller files removed."
\ No newline at end of file
......@@ -20,10 +20,54 @@ YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Progress tracking
TOTAL_STEPS=8
CURRENT_STEP=0
PROGRESS_PIPE="/tmp/installer_progress"
log() {
echo "$(date): $1" | tee -a "$INSTALL_LOG"
}
# Progress tracking functions
update_progress() {
local step=$1
local message="$2"
CURRENT_STEP=$step
local percent=$((step * 100 / TOTAL_STEPS))
# Update progress display
if command -v zenity >/dev/null 2>&1; then
# Use zenity for graphical progress (preferred)
echo "# $message" > "$PROGRESS_PIPE"
echo "$percent" > "$PROGRESS_PIPE"
elif command -v dialog >/dev/null 2>&1; then
# Use dialog for text-based progress
echo "$percent" | dialog --gauge "$message" 10 70 "$percent"
fi
print_status "$message ($percent%)"
}
start_progress_display() {
# Initialize progress display
mkfifo "$PROGRESS_PIPE" 2>/dev/null || true
if command -v zenity >/dev/null 2>&1; then
# Start zenity progress dialog in background
zenity --progress --title="MBetter Installation" --text="Starting installation..." --percentage=0 --auto-close < "$PROGRESS_PIPE" &
PROGRESS_PID=$!
fi
}
cleanup_progress() {
# Cleanup progress display
if [ -n "$PROGRESS_PID" ]; then
kill "$PROGRESS_PID" 2>/dev/null || true
fi
rm -f "$PROGRESS_PIPE" 2>/dev/null || true
}
print_status() {
echo -e "${GREEN}[INFO]${NC} $1"
log "INFO: $1"
......@@ -354,7 +398,12 @@ main() {
log "Starting offline installation process"
# Detect USB device and target disk
# Start visual progress display
start_progress_display
trap cleanup_progress EXIT
# Step 1: Device Detection
update_progress 1 "Detecting USB device and target disk..."
detect_usb_device
detect_target_disk || {
print_error "Cannot proceed without a target disk"
......@@ -365,19 +414,40 @@ main() {
print_status " Source: Live system (USB/CD: ${USB_DEVICE:-unknown})"
print_status " Target: $TARGET_DISK"
# Optional network configuration (not required for installation)
# Step 2: Network Configuration
update_progress 2 "Configuring network (optional)..."
configure_network
# Find preseed configuration
# Step 3: Find Configuration
update_progress 3 "Loading installation configuration..."
find_preseed
# All installation steps work completely offline
# Step 4: Disk Partitioning
update_progress 4 "Partitioning target disk..."
partition_disk
mount_target
copy_live_system # Copies live system instead of downloading
# Step 5: System Copy (longest step)
update_progress 5 "Copying live system to disk (this may take several minutes)..."
copy_live_system
# Step 6: System Configuration
update_progress 6 "Configuring target system..."
configure_target_system
# Step 7: Bootloader Installation
update_progress 7 "Installing bootloader..."
install_bootloader
# Step 8: Post-Installation Setup
update_progress 8 "Finalizing installation..."
run_post_install
# Complete
if command -v zenity >/dev/null 2>&1; then
zenity --info --title="Installation Complete" --text="Installation completed successfully!\nSystem will reboot in 10 seconds."
fi
cleanup
}
......
......@@ -18,6 +18,7 @@ grub-pc
grub-pc-bin
dialog
util-linux
zenity
# Comprehensive firmware packages for maximum hardware support
firmware-linux
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment