views:

245

answers:

4

Hey, I've just finished writing a VB.NET application. Now I want to package the executable and the database ofcourse into a single installer file. I tried using QSetup, InstallShield to make SQL Server embedded into the setup file, and finally after hours of try&fail I have no idea. Anyone?

+1  A: 

As far as I know, anything but the SQL Server Compact Edition (SQL Server CE) cannot be embedded into your setup, really. Microsoft doesn't want that - you need to have SQL Server Express installed separately - any other edition can't even be shipped with your software (the client must have a license and installation separately).

marc_s
thanks marc, I tried MSSQL Express and I succeed! But I have no idea how can I add my databse into that on the client system where the installation file would be executed. Can you be more clear please!?
Leszek Laszka
You can use restore database, or create a sql sqript for that
volody
agree, that comment was response to @Leszek comment
volody
+2  A: 

You can do a rightmouse on the properties of your Visual Studio Setup Project, and then there is this button 'Prerequisites'. There you can tick 'SQL Server Express ...' Or the 'SQL Server Compact 3.5'

image link to image

You're probably best off just to set the connection file directly to the mdf, and attach it when the program is run. This is easier as it doesn't require a custom setup script to install the database to the database directory itself.

Note: Consider using the Compact Version, it's smaller, people don't like a full blown engine on their computer :)

Snake
I'm not sure why a VDPROJ solution was accepted for a question that was tagged with InstallShield. Either way, I don't reccomend using VDRPOJ at all. You will be burned eventually.
Christopher Painter
+1  A: 

You can indeed distribute SQL server with your custom application:

http://msdn.microsoft.com/en-us/library/bb264562(SQL.90).aspx

Mikos
+2  A: 

InstallShield has a concept called Setup Prerequisites where you can teach it how to install additional packages along with your own. In older versions this would happen before calling your MSI. In newer versions you can have a "Feature" prerequisite where the prereq can associated to a feature and only installed if that feature is selected to be installed and after it's been selected but still before the main activity of your MSI occurs during the install execute sequence.

InstallShield also has a pattern for executing SQL scripts against your database instance so that you can then load your database into your newly installed instance.

All of this is quite powerful but it does take a bit of digging to learn.

Christopher Painter