=== modified file 'includes/menu.inc'
--- includes/menu.inc	2007-12-22 23:24:24 +0000
+++ includes/menu.inc	2007-12-23 00:15:42 +0000
@@ -336,6 +336,9 @@ function menu_execute_active_handler($pa
   if (_menu_site_is_offline()) {
     return MENU_SITE_OFFLINE;
   }
+  if (!db_result(db_query('SELECT COUNT(*) FROM {menu_router}'))) {
+    menu_rebuild();
+  }
   if ($router_item = menu_get_item($path)) {
     if ($router_item['access']) {
       if ($router_item['file']) {

=== modified file 'install.php'
--- install.php	2007-12-20 08:26:42 +0000
+++ install.php	2007-12-23 00:12:02 +0000
@@ -785,9 +785,8 @@ if (Drupal.jsEnabled) {
 
   // The end of the install process. Remember profile used.
   if ($task == 'done') {
-    // Rebuild menu to get content type links registered by the profile,
-    // and possibly any other menu items created through the tasks.
-    menu_rebuild();
+    // Force menu_rebuild on the next page.
+    db_query('TRUNCATE {menu_router}');
 
     // Register actions declared by any modules.
     actions_synchronize();

