Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.202
diff -u -p -r1.202 install.php
--- install.php	25 Aug 2009 21:53:46 -0000	1.202
+++ install.php	1 Sep 2009 15:36:46 -0000
@@ -568,7 +568,7 @@ function install_tasks($install_state) {
 
   // Now add any tasks defined by the installation profile.
   if (!empty($install_state['parameters']['profile'])) {
-    $function = $install_state['parameters']['profile'] . '_profile_tasks';
+    $function = $install_state['parameters']['profile'] . '_install_tasks';
     if (function_exists($function)) {
       $result = $function($install_state);
       if (is_array($result)) {
@@ -590,6 +590,18 @@ function install_tasks($install_state) {
     ),
   );
 
+  // Allow the installation profile to modify the full list of tasks.
+  if (!empty($install_state['parameters']['profile'])) {
+    $profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
+    if (is_file($profile_file)) {
+      include_once $profile_file;
+      $function = $install_state['parameters']['profile'] . '_install_tasks_alter';
+      if (function_exists($function)) {
+        $function($tasks, $install_state);
+      }
+    }
+  }
+
   // Fill in default parameters for each task before returning the list.
   foreach ($tasks as $task_name => &$task) {
     $task += array(
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.70
diff -u -p -r1.70 system.api.php
--- modules/system/system.api.php	31 Aug 2009 17:45:04 -0000	1.70
+++ modules/system/system.api.php	1 Sep 2009 15:36:46 -0000
@@ -2131,7 +2131,7 @@ function hook_registry_files_alter(&$fil
  * @see install_state_defaults()
  * @see batch_set()
  */
-function hook_profile_tasks() {
+function hook_install_tasks() {
   // Here, we define a variable to allow tasks to indicate that a particular,
   // processor-intensive batch process needs to be triggered later on in the
   // installation.
@@ -2193,6 +2193,23 @@ function hook_profile_tasks() {
 }
 
 /**
+ * Alter the full list of installation tasks.
+ *
+ * @param $tasks
+ *   An array of all available installation tasks, including those provided by
+ *   Drupal core. You can modify this array to change or replace any part of
+ *   the Drupal installation process that occurs after the installation profile
+ *   is selected.
+ * @param $install_state
+ *   An array of information about the current installation state. 
+ */
+function hook_install_tasks_alter(&$tasks, $install_state) {
+  // Replace the "Choose language" installation task provided by Drupal core
+  // with a custom callback function defined by this installation profile.
+  $tasks['install_select_locale']['function'] = 'myprofile_locale_selection';
+}
+
+/**
  * Alter MIME type mappings used to determine MIME type from a file extension.
  *
  * This hook is run when file_mimetype_mapping() is called. It is used to
