def install!
if @support_dir && @nginx_dir
show_welcome_screen
end
check_dependencies(false) || exit(1)
puts
if passenger_support_files_need_to_be_installed?
check_whether_we_can_write_to(@support_dir) || exit(1)
end
if nginx_needs_to_be_installed?
check_whether_we_can_write_to(@nginx_dir) || exit(1)
end
if passenger_support_files_need_to_be_installed? && should_download_binaries?
download_and_extract_passenger_binaries(@support_dir) do |progress, total|
show_progress(progress, total, 1, 1, "Extracting Passenger binaries...")
end
puts
puts
end
if nginx_needs_to_be_installed? && should_download_binaries?
download_and_extract_nginx_binaries(@nginx_dir) do |progress, total|
show_progress(progress, total, 1, 1, "Extracting Nginx binaries...")
end
puts
puts
end
if nginx_needs_to_be_installed?
nginx_source_dir = download_and_extract_nginx_sources do |progress, total|
show_progress(progress, total, 1, 7, "Extracting...")
end
if nginx_source_dir.nil?
puts
show_possible_solutions_for_download_and_extraction_problems
exit(1)
end
end
if passenger_support_files_need_to_be_installed?
install_passenger_support_files do |progress, total, phase, status_text|
if phase == 1
show_progress(progress, total, 2, 7, status_text)
else
show_progress(progress, total, 3..5, 7, status_text)
end
end
end
if nginx_needs_to_be_installed?
install_nginx_from_source(nginx_source_dir) do |progress, total, status_text|
show_progress(progress, total, 6..7, 7, status_text)
end
end
puts
color_puts "<green><b>All done!</b></green>"
puts
end