There is was too much duplication of code, the installib.php was incorrectly used for cli stuff instead of install stuff.
Also there are too many ifs, we should imo add general cli support and share much more code between /install.php, /admin/index.php. cli installer and cron
This can wait a bit, I hope this summer we will be working on weblib/pagelib rewrite.
In any case I did not test my changes in cli code yet, I am also planning several more ddl related (exceptions - yay!) and general session changes (I hope I will commit everything this weekend).
Any help will be appreciated later 
hmm - the CLI installer/upgrade code is not nice at all and needs to be rewritten