如何为我的C#窗口应用程序制作安装文件

如何为我的C#窗口应用程序制作安装文件

问题描述:

在我的 C#窗口应用程序中我已使用 SQL数据库…
所以有可能当我在 SQL SERVER 的时间创建我的C#窗口应用程序设置文件(表示已发布我的应用程序)时和我的SQL数据库包含在安装文件中...
因此,当我在Clint PC中安装我的应用程序时,那时候还要安装SQL Server和我的数据库".
如果不可能,请告诉我最佳方法,该方法是如何在应用程序中创建设置文件以及如何在客户端中添加 SQL Server 我的SQL数据库 PC ..
所以我将在客户端PC中安装我的应用程序.
而且我可以启动我的应用程序

In My C# Window Application I Have Used SQL Databased…
So It’s Possible When I Create My C# window application Setup File( means Published my Application ) at time SQL SERVER and My SQL Database are include in setup File…
So when I install my application in Clint PC At That time also install SQL server and My Database.
If is Not Possible Then Tell me Best way How to Make Setup File of My Application and How To add SQL Server And My SQL Database in Client PC..
so I will install my application in client PC .
And I can Start my Application

您不应在安装中包括SQL Server.有两个原因:
0)您只能出于版权原因分发SQL Server Express-不能分发SQL Server完整版.
1)他们可能已经在网络上安装了SQL Server.如果是这样,那么他们大概会想使用该版本.
2)如果他们确实安装了SQL Server,并且您开始激增SQL Server Express实例,那么您将烦恼数据库管理员...
3)与在用户控制下的多个分散版本相比,备份SQl Server的单个站点的可能性要大得多.
4)对于普通"用户来说,安装和管理Sql Server非常复杂-这不是一个好主意!
5)它将破坏使用SqlServer而不是SqlCE或SQLite的主要优势-多用户访问.如果每个人都安装了自己的SQL Server副本,那么您将拥有数据库的多个副本,每个副本都由一个人使用.这将引起一些混乱,并且(取决于您编写原始数据库的方式)可能会花费一些精力才能在问题解决后合并到一个实例中.
You should not include SQL Server in your installation. There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.


您可以使用设置和部署项目.在MSDN上进行检查.
You can do that using set up and deployment projects. Check it out on MSDN.


在文件"菜单上,指向添加",然后单击新建项目".

在出现的添加新项目"对话框的项目类型"窗格中,打开其他项目类型"节点,打开安装和部署项目",然后选择"Visual Studio安装程序".

在模板"窗格中,选择要创建的部署项目的类型.有关更多信息,请参见安装和部署项目.

要将现有部署项目添加到解决方案中,

在文件"菜单上,指向添加",然后单击现有项目".

在出现的添加现有项目"对话框中,浏览到部署项目的位置,然后单击打开".
On the File menu, point to Add, then click New Project.

In the resulting Add New Project dialog box, in the Project Types pane, open the Other Project Types node, open Setup and Deployment Projects, and select Visual Studio Installer.

In the Templates pane, choose the type of deployment project you want to create. For more information, see Setup and Deployment Projects.

To add an existing deployment project to a solution

On the File menu, point to Add, then click Existing Project.

In the resulting Add Existing Project dialog box, browse to the location of the deployment project and click Open.