All,
What's the simplest way of a deployment of an application written in C# and
using ADO.NET and MS SQL Server?
I created a deployment project in the VS2005, aded it to the solution,
configured, added the main project. The deployment project creates 2 files -
setup.exe and MyApplication.msi, it automatically checks for the existence
of MDAC and MS SQL Server 2005 Express Edition, that's fine. But to install
the application correctly I need to create a database, setup all required
permissions, then copy one DB table, which is heavy enough and should be
copied to the target DB if it's not yet created. Should I write a separate
app that can be called after I install the main application to take care of
the database? Or there is an easier way of doing that?
Also if the client machine already has a previous version of the database
and I need to upgrade it to the latest version what should I do to keep the
client's data? To analyze the database using my own application and then
upgrade the DB using some script? Or there is an easier way of doing that?
Any good ideas and/or hints will be greatly appreciated!
Thanks,
Just D.
Sébastien Ros - 06 Jan 2008 09:45 GMT
You can add you own custom code in other "steps" (called custom actions)
inside the setup. In those steps, you will be able to execute the database
initialization, using for instance a db restore command.
NB: You can also use a file based database with SQL Server Express 2005,
which would be easier for you, just embed the db as a "content" file in your
application.
In order to create and execute custom action during the installation, look
at this tutorial:
http://msdn2.microsoft.com/en-us/library/49b92ztk(VS.80).aspx