You can't get this for free from WiX.
Using SqlString, some parameters and as you noted direct use of CREATE DATABASE. You'll need:
- DB_SERVER
- DB_INSTANCE
- DB_PORT
- DB_DATA_FOLDER
- DB_LOG_FOLDER
If you are expecting to use SQL auth you'll of course also need to pass in DB_USER/DB_PASS
I would strongly suggest writing your own custom actions to verify the parameters.
- Do the server/instance exist on the local machine? While you can always remotely connect to a SQL server and tell it to install files on a given drive it makes it harder to validate anything about those drives in advance.
- Using the given Server/Instance/Port and credentials can you connect to the sql server master DB, you might even check permission to create DB in advance. You can get away with not using Port but some DBAs still go for security through obscurity.
- Were you given valid Data/Log folders. Rooted paths to drives that actually exist.
- Verifying enough space on the Data/Log folder drive is a good idea as well. I've run into plenty of customer who don't check and wind up with their data files on the tiny C: drive with an empty huge D: data drive. I usually do a combination minimum free space as well as minimum free percentage (e.g. at least 25% free space on disk)