diff --git a/includes/install.inc b/includes/install.inc
index 5e1d3c6..633b9f3 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -687,6 +687,12 @@ function drupal_verify_profile($install_state) {
   if (!isset($profile) || !file_exists($profile_file)) {
     throw new Exception(install_no_profile_error());
   }
+
+  // Prime the drupal_get_filename() static cache with the profile info file
+  // location so we can use drupal_get_path() on the active profile during
+  // the module scan.
+  drupal_get_filename('module', $profile, $profile_file);
+
   $info = $install_state['profile_info'];
 
   // Get a list of modules that exist in Drupal's assorted subdirectories.
