Details
Description
(As described here: http://forum.civicrm.org/index.php/topic,19655.msg81800.html)
The install script '<CiviCRM root>/install/index.php' is using different logic than Drupal for mapping the URL to the site configuration folder, causing problems with multi-site sub-directory setups (and presumably anyone using Drupal 7's new sites.php feature).
Use case:
Shared-codebase, single-domain, subdirectory-URL multi-site installation of D7 / CiviCRM 4. (ie. a single D7 / CiviCRM codebase in apache's doc root directory, using symlinks in the doc root directory to point the subdirectory sites back to Drupal's index.php. In the sites folder I have folders called mydomain.org, mydomain.org.subdir1, mydomain.org.subdir2, etc.)
Drupal will install successfully on the root site (mydomain.org) and sub-directory sites (ie. mydomain.org/subdir1), but when trying to install CiviCRM on sub-directory sites such as "mydomain.com/subdir1" by going to "http://mydomain.org/subdir1/sites/all/modules/civicrm/install/index.php" CiviCRM complains that it is already installed with the message:
"Oops! CiviCRM is Already Installed
CiviCRM has already been installed in this Drupal site.
To start over, you must delete or rename the existing CiviCRM settings file - civicrm.settings.php - from [your Drupal root directory]/sites/mydomain.org."
Thus, the install script isn't noticing the sub-directory in the URL.
Fix:
It looks like getSiteDir( $cmsPath, $str ) attempts to re-implement conf_path() in from older versions of Drupal. I've altered 'install/index.php' and changed getSiteDir() to simply call Drupal's conf_path() which seems to have things working properly. The caveat is that it uses a Drupal specific call even though Drupal specific code seems to be handled only conditionally in 'install/index.php'. Perhaps the historical reason for this is the stand alone installer? I'm not sure.