Making a setup for C#/SQL app

2019-08-03 17:24发布

问题:

this is my first post in stackoverflow, I've always checked this site by searching in google, so I decided to join it myself! I hope to be useful to others

I'm a 3d developer (DirectX), but recently I've started making an SMS gateway using C# and SQL Express, now I'm going to create a setup file for my project (which uses .NET 3.5), what are my options? I've heard that VS 2008 can make setup, is there any sample? how can I include SQL express in my setup app? also I've downloaded Install Shield 2010 which has a built-in support for VS 2008, I want to make my setup in a way that it detects SQL on target system and if it finds SQL already installed, doesn't try to install it again (the same rule can be applied for .NET), what are my options? how can I make such a setup file?

thanks

回答1:

With Microsoft's Visual Studio, there is an inbuilt Setup Template which you can use.

  • Click Once

    For your scenario you should take a look at Adding Click once Custom Prerequisites.

  • Setup And Deployment Application

    For your scenario you should take a look at the Walk-through.

Or as you mentioned you have InstallSheild 2010 then:

  • Install Shield Wizard

    Take a look at this Walk-through with Limited Edition

As for SQL Server i think you can usually go as far as SQL Server Compact Edition. (For anything greater you may need to Inform User to install it himself)



回答2:

I have no personal experience with it, but SQL Server 2008 Compact might be good for this. It is an embedded solution so so you don't actually need to install a server. Alternatively you could look at SQLite, which has native .NET implementations (google for "sqlite .net").