Deploying WPF applications with SQL Server
Ok so I'm developing a WPF application that makes heavy use of SQL Server. I've been asked to create an installer package that checks whether the client already has SQL Server Express 2005 already installed, his operating system (64bit Vs x86) and install the required SQL Server instance if needed.
I'm then required to automatically map my App.config's connection string to the SQL Server's connection string and run a script to create my database.
Is it just me, or does this look like a lot of hard work? Any idea where开发者_Go百科 to start?
Edit: Ok should I move to SQL Server Compact edition?
Thanks!
Unfortunately this sounds about right; one the guys on my team got lumped with this job and it's been taking up a significant amount of his time to do all of this. Using install shield to fire off the necessary SQL install packages and then go into all the various app.configs and edit any paths/connections that are unique to the machine.
Further down the line we've also had to consider the fact that every machine has a potentially unique app.config file so we had to add/delete and edit various keys as part of a software upgrade.
As above, we've been using Install shield to handle all of this. Just don't expect it to be a quick job!
No it is not just you, this will be a lot of work! It is also incredibly difficult and time consuming to get right.
A common approach to this problem i.e. having large system dependencies, is to have the dependency (in this case SQL server) as a "pre-requisite" to installing your software. Your installation package checks to see if the dependency is installed, and if it isn't, advises the user that it needs to be in place before installing your software. If the dependency does exist, then your package can go through the steps of installing your schema into it.
The onus is then on the user, or the systems administrator\IT, to get the dependency set up. This may even be required as the user may not have privileges to install something like SQL server. The user may even want to use a shared database i.e. not on their local machine. Not sure what your circumstances are...
Based on your question, it seems that the client and the server is always going to be on the same machine, no remote access.
Today with Entity Framework you have almost full support of SQL Server CE, I think you would really want to take a look on it.
精彩评论