Index: includes/install.core.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.core.inc,v
retrieving revision 1.28
diff -u -p -r1.28 install.core.inc
--- includes/install.core.inc	1 Sep 2010 01:24:05 -0000	1.28
+++ includes/install.core.inc	13 Sep 2010 22:51:53 -0000
@@ -275,12 +275,12 @@ function install_begin_request(&$install
   require_once DRUPAL_ROOT . '/includes/cache-install.inc';
   $conf['cache_default_class'] = 'DrupalFakeCache';
 
-  // Prepare for themed output, if necessary. We need to run this at the
-  // beginning of the page request to avoid a different theme accidentally
-  // getting set.
-  if ($install_state['interactive']) {
-    drupal_maintenance_theme();
-  }
+  // Prepare for themed output. We need to run this at the beginning of the
+  // page request to avoid a different theme accidentally getting set. (We also
+  // need to run it even in the case of command-line installations, to prevent
+  // any code in the installer that happens to initialize the theme system from
+  // accessing the database before it is set up yet.)
+  drupal_maintenance_theme();
 
   // Check existing settings.php.
   $install_state['settings_verified'] = install_verify_settings();
