How can I detect whether the install process is running? I'm looking for a way to reliably detect whether Drupal's install process is currently running, either via drush site-install or install.php.

The immediate problem I'm trying to solve is that I have some settings (using Redis as cache backend) in settings.php which cause the installation to fail. So I'd like to wrap that block of settings in something like if (!drupal_installation_is_currently_running()) { … }

I have not managed to figure out how that can reliably be determined. Any suggestions?
You're probably looking for drupal_installation_attempted():


  Returns TRUE if a Drupal installation is currently being attempted.