0

When I build my software, is it possible for me to incorporate everything from the solution with the software installer (perhaps using InstallSheild?)

The software I am writing at the moment uses a database with SQL, and is written in C# 5.0, so how would I install the database, SQL, C#, .NET etc. onto my clients computer when installing the software?

tony b
  • 1,341
  • 2
  • 10
  • 12
  • What type of database are you using? – TGH Oct 04 '13 at 03:36
  • SQL Server 2012 Edition? – tony b Oct 04 '13 at 03:38
  • It probably doesn't make sense to install sql server on the client if this is a single user application. If many users share the same DB it makes more sense to install sql server on a separate shared server instance – TGH Oct 04 '13 at 03:39
  • no, sorry, its just for the one computer, it wont be installed on anything else. Whats the easiest way to do it? – tony b Oct 04 '13 at 03:40
  • 2
    I would look into Sql Compact edition since it is a single file based client database. Sql Server is usually not an appropriate database for single user applications. Installing Sql Server is relatively involved too – TGH Oct 04 '13 at 03:45
  • But my database is already created using sql server, how would i go about doing it now? Add an installer of sql compact with the software? – tony b Oct 04 '13 at 03:46
  • 1
    Here's a link about compact edition http://msdn.microsoft.com/en-us/data/ff687142(v=msdn.10).aspx Take a look and learn more about it so that you can make a decision if this is appropriate for your solution or not. – TGH Oct 04 '13 at 03:49
  • Brilliant, thank you :) will have a look now. So, how would i attach the database to my installer so it went wherever the software did? – tony b Oct 04 '13 at 03:50
  • You can probably include it in your app as a file (database file) – TGH Oct 04 '13 at 03:56
  • brilliant. I should be able to do all of that with InstallShield? Or is that done in Visual Studio? Thanks btw, you should have put it as an answer, id have marked you up :) – tony b Oct 04 '13 at 04:02

2 Answers2

0

Yes, you can do that with an installer. InstallShield would do it but is quite pricey. Wix Toolset would do it and it's free, but it's not the friendliest installer I ever worked with (though it does work very well once you get the hang of it).

Both of those allow pretty straightforward installation of the .NET framework. You will need to work a bit at getting SQL installed.

While you could install SQL Server Full or Express this way it would be MUCH easier to use SQL Compact. I can't remember the license, but I'm pretty sure you can deploy the SQL Compact DLLs with your project and don't need to actually install it.

Zippit
  • 1,673
  • 1
  • 11
  • 11
0

Yes you can deploy SQL database and the .Net frame work with your installation package. You could achieve this with Windows Installer as well.

Deploying Sql database with MSI

You have to first add your sql script file with your msi package script should have necessary steps to create database schema when its being executed on the SQL database. You can use SMO(Sql server Management Object) library to execute this script content on sql database. Check my other thread where I have posted working method to read the file content and execute on SQL database to create the database during deployment.

Execute sql script on SQL server using C#

Deploying .Net Frameowrk

Go to MSI Project > Properties > Prerequisites > Download prerequsites from the same location as my computer.

.Net Framework MSI

When you build you MSI project with this configuration your will get an extra exe file dotNetFx40_Full_x86_x64.exe which can deploy .Net framework on client machaines. You can execute this MSI when your application being installed.

Community
  • 1
  • 1
Kurubaran
  • 8,696
  • 5
  • 43
  • 65
  • On an unrelated note, please don't [approve suggested edits](http://stackoverflow.com/review/suggested-edits/3063975) using backticks for non-code, but reject or improve them - see e.g. [here](http://meta.gaming.stackexchange.com/q/7437/88) why – Tobias Kienzler Oct 04 '13 at 09:38