[英]Creating Exe/MSI for C# Windows Forms using Visual Studio 2017 Setup Project
I'm trying to create exe/msi for my solution 我正在尝试为我的解决方案创建exe / msi
it contains the following Projects 它包含以下项目
Here is the contents of the Setup project: 这是Setup项目的内容:
I tried the same steps for different Solution, with ONLY one windows forms application, and it worked fine, but it looks that it doesn't work when I have more than one referenced projects. 我对不同的解决方案尝试了相同的步骤,仅使用一个Windows窗体应用程序,但效果很好,但是当我有多个引用的项目时,它似乎不起作用。
The install and Uninstall options are not enabled 未启用安装和卸载选项
Update: 更新:
all the previous projects are referenced in the Win forms project, so am I targeting the right one when creating the exe/msi? Win窗体项目中引用了以前的所有项目,因此在创建exe / msi时我是否要针对正确的项目?
The only project with the Install option is the setup project. 带有“安装”选项的唯一项目是安装项目。 Other projects in the solution do not have install option just because there is a setup project as part of the solution.
解决方案中的其他项目没有安装选项,只是因为有一个安装项目作为解决方案的一部分。
References in a non-setup project (such as a C# build) are not automatically included in a setup project. 非安装项目(例如C#构建)中的引用不会自动包含在安装项目中。 References used to build code are not necessarily things that need installing on the target system.
用于构建代码的引用不一定需要在目标系统上安装。 The setup will try to help with dependencies, but it's unreliable, and only a guide.
该安装程序将尝试帮助解决依赖关系,但这是不可靠的,仅是一个指南。 For example, your Application Folder view contains some files that are part of the .NET Framework, and you definitely don't install them because they are installed as part of the standard .NET framework install.
例如,您的“应用程序文件夹”视图包含一些.NET Framework的文件,由于它们是作为标准.NET Framework安装的一部分安装的,因此您绝对不要安装它们。
The setup project must be told what needs to be installed on the target system. 必须告知安装项目在目标系统上需要安装什么。 There are generally two ways of doing this:
通常有两种方法可以执行此操作:
Selecting project output as input to the setup project. 选择项目输出作为设置项目的输入。 This can be rather indeterminate because it's not always obvious what files are included, or what to do if the files need installing to different locations.
这可能是不确定的,因为并不总是清楚地包括了哪些文件,或者如果文件需要安装到不同的位置该怎么办。
Add the files that you know you need one at a time by adding them in the File System view of the directory they need installing into. 通过一次将所需的文件添加到需要安装到的目录的“文件系统”视图中,来添加它们。 Typically, executables go into the Application Folder (defaults to Program Files..), data files to User's Application Data, shared files to Common Files folder, some assemblies to the GAC and so on.
通常,可执行文件进入“应用程序文件夹”(默认为“程序文件..”),数据文件进入“用户的应用程序数据”,共享文件进入“通用文件”文件夹,某些程序集进入GAC,依此类推。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.