I will be distributing a database with the application, so my plan was to check to see if the user had SQL Express installed, if not, then give them the option to download and install it. (If the user chooses, they can create the database on their own SQL Server, and I already have that logic built into my dialogs.) I think that part is ok - in that I can download SQL Express and install it, creating my own instance for my app.
But, what if the user already has SQL Express installed? What I'd like to do is have SQL Express create my own instance for the app, but I can't figure out how to do this. Furthermore, I can't figure out where in the install to check for the existence of my instance and create it. I don't want to force the user to redownload SQLExpress if its already there, but I want my database to be attached to its own instance. (Or is this bad form and I should always use the default instance?)
Once the database software is installed, or my instance is created, is there anything special I will need to do to start that instance up so that I can start sending SQL commands to it during the install?
Finally, is there a good way to pass information to a SQL script from the installer, or to have the installer run a SQL script it generates from properties on the fly? I'm looking to attach my MDF / LDF files to a new database on the instance, and I'm going to need to know the path to the files, as picked by the user in the installer.
Whew - I have my work cut out for me.
FOLLOW US
Get the latest news in Application Packaging