depoly sql server 2008 express r2 and execute database script

coolcurrent4u

Newcomer
Joined
Apr 30, 2011
Messages
3
Hello,

i need to package and deploy sql server express r2 with visual studio installer 2010, and execute a database create script at the end of the installation.

I am deploying a client and server version of my application, i will present a dialog "choose which app to install, client or server".if the use choose server, then install sql server, if client then skip sql server installation.

the first issue is, i have been able to create a bootstrap for sql server r2 and create the installer dll that will execute the database create file, but i get an error shown in the image.

the second issue is that how do i let the user choose weather to install sql server or not in the deployment process.

thanks
 

Attachments

I do this by way of an ConfigurationFile.ini, and use a script to run the install, make sure the server is started, then execute the script via SQLCMD.

Essentially you can run through a setup and create all of the configuration parameters in a single ini file creating a user interaction-less install.

http://msdn.microsoft.com/en-us/library/dd239405.aspx

Then launch setup from a script like "SETUP /CONFIGURATIONFILE=ConfigurationFile.ini /IAcceptSQLServerLicenseTerms"

Then pass the script via the command line as detailed here
http://msdn.microsoft.com/en-us/library/ms162773.aspx

like SQLCMD -e -i .\MyScript.sql

Package the whole thing as a separate installer, and include the Installer package in the main installer.

There are likely better methods, but this one has worked for me for quite a while and never had an issue.
 
Back
Top