The sketch of an algorithm would look something like:
- check prerequisites (directories have necessary permissions, mysql and php is of required version etc.)
- if no POST data exist - show form for database details (user, password, name).
- else connect to the database and create tables
- copy/create necessary files (if any)
- write some config file.
I didn't work with Dreamweaver so I don't know what it can or can't do.