Click here to Skip to main content
15,912,021 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
:) Hi all,

Recently I have implemented a windows client program using C# .NET for managing a database. I made a installation setup using visual studio setup project. Now I have two issues.

1) If I install it in another computer I have to separately install .NET framework and MSsql server(if they are not installed already).

2) I have a database script which should run at first instance to create database , create all tables, insert primary data.

Considering users convinient I need to integrate all this tasks to a single installer and left no hard work end user.

If you have any experties please share with me.

Regards.
Posted

I wrote a Win32 app that runs the .NET install and the DB, and a .NET app that gets run after my MSI to run my DB scripts.
 
Share this answer
 
Comments
isuruanu 6-May-10 6:21am    
Hi Christian

What I want exactly is to check and verify weather .NET and MSSql server already installed. If not installer should install it and then execute Database script file to genarate database.
Thanks in advance.
You should be able to get the .Net installation to tie into a Visual Studio setup project by specifying that it's a prerequisite. I've only created setup projects for vb.net projects, but I'd think it would be the same for C#. In the setup project right click on the project in the solution explorer. Then click the Prerequistes button. Then check the box next to the .Net framework you need. When a user who doesn't have the .Net framework runs your setup, it will first check for .Net and then install it first. You can also tie in SQL Server Express Edition this way. Not sure if you need the full version how that would work.

Regarding your script issue, I have a project that works similar. When the application first launches it checks a condition. If the condition specifies that scripts need to be run, it looks for a textfile that I've included in the setup which contains database scripts and runs them. Perhaps some feature like that would work for you as well.

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900