Actually now that I think about this why not just keep it simple in the beginning and forget the DataBase part of this.
Those Optional folders could simply have installation files on them.
Optinal1 could have Joomla installation setup in it.
Optinal2 could have Drupal installation setup in it.
Optinal3 could have Mediawiki installation setup in it.
Then if the Site owner wanted to create Joomla site easily all they would have to do is mark the Optional1 tab under the 'Own Error-Documents' tab on their 'Site' page and voila the Joomla installation files would have been copied to a sub folder on their site.