I've written an app which bootstraps SQL Express 2008 with a Wix 3.5 installer, then attempts to CREATE DATABASE on first run of the app. The install of SQL Express is thus totally unattended. This all works fine when the account installing the app is an Administrator on the machine.
However, somewhat unsurprisingly, problems arise when installing as non-admin. When we try to run CREATE DATABASE sql it squarks -
sql express 2008 create database permission denied in database 'master'
Obviously the standard user account doesn't have the correct privilege. So somehow we need to grant the standard user the correct privs. I have thought of bundling a separate executable which is forced to run as Admin (via UAC) which would create the database and assign privileges on the new database to the user account - not a very elegant solution.
This seems like an obvious thing you'd want to do when deploying an app but there seems to be a dearth of information on the subject. Looking for suggestions - thanks.