Fix auto-installer hanging at zenity confirmation dialog

- Zenity dialog was hanging in terminal environment without proper GUI context
- Replaced unreliable GUI dialogs (zenity/dialog) with terminal confirmation
- Added clear warning display with colored output for visibility
- Simplified confirmation logic with case statement for multiple valid inputs
- Auto-installer now continues reliably without GUI dialog dependencies

Terminal confirmation is more reliable in live CD terminal environments.
parent a6181d5c
......@@ -262,35 +262,30 @@ confirm_installation() {
print_warning "All existing partitions and data will be permanently destroyed!"
print_status ""
# Use graphical confirmation if available
if command -v zenity >/dev/null 2>&1; then
zenity --question \
--title="Installation Confirmation" \
--text="Ready to install MBetter to $TARGET_DISK\n\nWARNING: This will COMPLETELY ERASE all data on $TARGET_DISK!\n\nTarget disk: $TARGET_DISK ($size_gb GB)\nModel: $model\n\nContinue with installation?" \
--width=400 \
--height=200
return $?
elif command -v dialog >/dev/null 2>&1; then
dialog --title "Installation Confirmation" \
--yesno "Ready to install MBetter to $TARGET_DISK\n\nWARNING: This will COMPLETELY ERASE all data on $TARGET_DISK!\n\nTarget disk: $TARGET_DISK ($size_gb GB)\nModel: $model\n\nContinue with installation?" \
15 70
return $?
else
# Terminal confirmation as fallback
echo ""
echo -e "${RED}WARNING: This will COMPLETELY ERASE all data on $TARGET_DISK!${NC}"
echo "Target disk: $TARGET_DISK ($size_gb GB)"
echo "Model: $model"
echo ""
echo -n "Continue with installation? (type 'yes' to confirm): "
read -r confirmation
if [ "$confirmation" = "yes" ] || [ "$confirmation" = "YES" ]; then
# Use terminal confirmation for reliable operation
# GUI dialogs can hang in some terminal environments
print_status "Using terminal confirmation for reliable operation..."
echo ""
echo -e "${RED}==================== INSTALLATION WARNING ====================${NC}"
echo -e "${RED}This will COMPLETELY ERASE all data on $TARGET_DISK!${NC}"
echo -e "${RED}All existing partitions and data will be permanently destroyed!${NC}"
echo -e "${RED}=============================================================${NC}"
echo ""
echo "Target disk: $TARGET_DISK ($size_gb GB)"
echo "Model: $model"
echo ""
echo -e "${YELLOW}Ready to begin installation?${NC}"
echo -n "Continue with installation? (type 'YES' to confirm): "
read -r confirmation
case "$confirmation" in
YES|yes|Y|y)
return 0
else
;;
*)
return 1
fi
fi
;;
esac
}
# Partition disk automatically
......
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