--- install.inc	7 Sep 2007 10:48:24 -0000	1.48
+++ install.inc	25 Sep 2007 01:41:55 -0000
@@ -303,6 +303,11 @@ function drupal_verify_profile($profile,
  *   An array of modules to install.
  */
 function drupal_install_profile($profile, $module_list) {
+  // Increase the script time limit during installation if not in safe mode.
+  if ((int)ini_get('max_execution_time') < 240) {
+    set_time_limit(240);
+  }
+
   // The system module is a special case; we can't bootstrap until it's
   // installed, so we can't use the normal installation function.
   $module_list = array_diff($module_list, array('system'));
