Create database with bootstrapped SQL Express
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.
It is a fairly usual prequisite that when installing an app, you need to be an administrator on the machine you are installing it. Why can you simply not make it a prequisite? Most sysadmins don't want their non admin users installing apps anyway.
Turns out you can do all of this with WiX, with the SQL Extension.
http://www.tramontana.co.hu/wix/lesson7.php#7.1
精彩评论