There are a lot of scenarios where config.php exists but there are no database tables (one example is debian packaging).
There are a few different options:
- install.php should either be split into createconfig.php and installdb.php,
- upgrade.php should handle upgrading from 0
- some of the code in install.php should be abstracted so it can be reused by a new script.