There are some parts of the installation process that don't check for ajax request issues (timeout, syntax error, server error codes, etc) leaving the user with no clue on what is wrong.
This PR corrects that and also improves the error messages by replacing javascript alert messages with joomla message errors.
Didn't change the ftp part because don't have way to test it
Testing Instructions
First apply this patch
Delete configuration.php and reload any site page you'll be redirect to installation
When in installation view: Clear all browser cache
Test no regresssions: normal installations and check everything is fine
Repeat step 2.
Test forcing errors, for checking you always get some error message:
Add an sql error in joomla.sql file. Try to install, you should get an error
Add some non php text (anything that generates a php syntax error) inside /installation/model/configuration.php. Try to install, you should get an error
Rename /installation/controller/site.php to anything. Try to install, you should get an error
It's really hard to see scope of changes when you've changed whitespace formatting.