hi, the way I've done it is by creating 3 files:
install.php - A simple Form that takes relavant infomation
do_install.php - Takes the infomation from the form, assigns them to variables, then creates a config file based around the variables.
create_databse.php - Using the newly created config file, makes and populates the database fields.
Hope that helps