@@ -471,17 +471,33 @@ main() {
471471 print_success " Installation complete: $install_path "
472472
473473 # Verify binary integrity (SHA256 + attestations)
474- verify_binary_integrity " $install_path " " $release_tag " " $arch "
474+ local integrity_failed=false
475+ if ! verify_binary_integrity " $install_path " " $release_tag " " $arch " ; then
476+ integrity_failed=true
477+ fi
475478
476479 # Test binary
477- if " $install_path " --version > /dev/null 2>&1 ; then
480+ local test_output test_exit_code binary_failed=false
481+ test_output=$( " $install_path " --version 2>&1 )
482+ test_exit_code=$?
483+
484+ if [[ $test_exit_code -eq 0 ]]; then
478485 local version_info
479- version_info=$( " $install_path " --version | head -1)
486+ version_info=$( printf ' %s ' " $test_output " | head -1)
480487 print_success " Binary test passed"
481488 print_info " Version: $version_info "
482489 else
483- print_warning " Binary test failed - the binary may not be compatible with your system"
484- print_warning " You may need to install additional dependencies"
490+ binary_failed=true
491+ print_warning " Binary test failed"
492+ if [[ $test_output == * " Exec format error" * ]]; then
493+ print_error " Architecture mismatch detected - wrong binary for your system"
494+ print_info " Solution: Install qemu-user-static to run different architectures"
495+ print_info " - On Alpine: apk add qemu-user-static"
496+ print_info " - On Debian/Ubuntu: apt-get install qemu-user-static"
497+ else
498+ print_warning " The binary may not be compatible with your system"
499+ print_info " Try: ldd $install_path (to check missing libraries)"
500+ fi
485501 fi
486502
487503 # PATH check
@@ -491,7 +507,18 @@ main() {
491507 print_info ' Then run: source ~/.bashrc'
492508 fi
493509
494- print_success " Installation completed successfully!"
510+ # Final status message
511+ if [[ $integrity_failed == true ]] || [[ $binary_failed == true ]]; then
512+ print_warning " Installation completed with errors!"
513+ if [[ $binary_failed == true ]]; then
514+ print_info " Binary test failed - the application may not work properly"
515+ fi
516+ if [[ $integrity_failed == true ]]; then
517+ print_info " Integrity verification failed - consider re-downloading"
518+ fi
519+ else
520+ print_success " Installation completed successfully!"
521+ fi
495522 print_info " Run with: qbittorrent-nox"
496523}
497524
0 commit comments