Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.235
diff -u -p -r1.235 install.php
--- install.php	14 Jan 2010 18:45:17 -0000	1.235
+++ install.php	16 Jan 2010 22:54:19 -0000
@@ -1528,39 +1528,43 @@ function install_check_requirements($ins
     $writable = FALSE;
     $conf_path = './' . conf_path(FALSE, TRUE);
     $settings_file = $conf_path . '/settings.php';
-    $file = $conf_path;
+    $default_settings_file = './sites/default/default.settings.php';
     $exists = FALSE;
-    // Verify that the directory exists.
-    if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
-      // Check to make sure a settings.php already exists.
-      $file = $settings_file;
-      if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
-        $exists = TRUE;
-        // If it does, make sure it is writable.
-        $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
+    // Check if a settings.php file already exists and is writable.
+    if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
+      $exists = TRUE;
+      $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
+    }
+    // If a settings.php file doesn't already exist, try to copy the default
+    // settings file to create one.
+    else {
+      if (drupal_verify_install_file($conf_path, FILE_EXIST|FILE_WRITABLE, 'dir') && @copy($default_settings_file, $settings_file)) {
         $exists = TRUE;
+        $writable = TRUE;
       }
     }
 
     if (!$exists) {
-      $requirements['settings file exists'] = array(
-        'title'       => st('Settings file'),
-        'value'       => st('The settings file does not exist.'),
-        'severity'    => REQUIREMENT_ERROR,
-        'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('@drupal' => drupal_install_profile_distribution_name(), '%file' => $file, '%default_file' => $conf_path . '/default.settings.php', '@install_txt' => base_path() . 'INSTALL.txt')),
-      );
+      if (!$writable) {
+        $requirements['settings file'] = array(
+          'title'       => st('Directory and file permissions'),
+          'value'       => st('Not set correctly.'),
+          'severity'    => REQUIREMENT_ERROR,
+          'description' => st('The installer requires write permissions to the %directory directory and the %file file during the installation process. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('%directory' => $conf_path, '%file' => $default_settings_file, '@handbook_url' => 'http://drupal.org/server-permissions', '@install_txt' => base_path() . 'INSTALL.txt')),
+        );
+      }
     }
     else {
       $requirements['settings file exists'] = array(
         'title'       => st('Settings file'),
-        'value'       => st('The %file file exists.', array('%file' => $file)),
+        'value'       => st('The %file file exists.', array('%file' => $settings_file)),
       );
       if (!$writable) {
         $requirements['settings file writable'] = array(
           'title'       => st('Settings file'),
           'value'       => st('The settings file is not writable.'),
           'severity'    => REQUIREMENT_ERROR,
-          'description' => st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>.', array('@drupal' => drupal_install_profile_distribution_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')),
+          'description' => st('The installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>.', array('%file' => $settings_file, '@handbook_url' => 'http://drupal.org/server-permissions')),
         );
       }
       else {
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.124
diff -u -p -r1.124 install.inc
--- includes/install.inc	13 Jan 2010 05:08:29 -0000	1.124
+++ includes/install.inc	16 Jan 2010 22:54:19 -0000
@@ -379,7 +379,7 @@ abstract class DatabaseTasks {
       $this->pass('Drupal can CONNECT to the database ok.');
     }
     catch (Exception $e) {
-      $this->fail(st('Failed to connect to your %name database server. %name reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => $e->getMessage(), '%name' => $this->name())));
+      $this->fail(st('Failed to connect to your %name database server. %name reports the following message: %error.<ul><li>Are you sure the database exists and you have typed the correct database name?</li><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => $e->getMessage(), '%name' => $this->name())));
       return FALSE;
     }
     return TRUE;
