I have written a software application that includes an installer, that is to be used by Mr Layman to install the system on to a single computer.
The system is a simple C# winforms application with an SQL Express database. The target machine would be a standard installation of Windows XP with SQL Express and .NET 3.5 installed.
I am able to create the installer for the winforms app, that would check the version, create all the directories and copy over all the necessary executable's etc. I have also an SQL script that will create the database and populate it with the necessary data. However I do not know how to go about creating a stand alone installer for the database on the target machine.
I have an SQL script that will create the database etc, but how do I make the installer run this script? I've had a google and I don't really know what I'm looking for, can someone point me in the right direction please.
Thank you in advance.
Create a custom action in the installer project that will take your SQL script and run it against the database. Here's an MSDN link that covers the basics.
An installer which runs SQL scripts can be created in 2 ways:
The very hard way:
The easy way:
If you want a free solution, I recommend WiX. It has a steep learning curve, but it does what you need.