On my install it's failing on the Kohana::init() call because it can't create the cache dir - which makes sense.  So I agree - we can't use the Kohana framework here.  However, I'm thinking that it doesn't make sense to do this in the bootstrap because theoretically that's a shared, common code path that'll used by different configurations (where index.php is a configuration).  For example - when we embed in Drupal we'll use bootstrap, but a different configuration.  So let's put this code in index.php after we define VARPATH, eg:

```
// If var/database.php doesn't exist, then we assume that the Gallery is not properly installed                                                            
// and send users to the installer.                                                                                                                        
if (!file_exists(VARPATH . "database.php")) {
  header("Location: installer");
  exit;
}
```

can you update the pull req, Tim?