简体   繁体   English

Visual Studio将项目发布到一个简单的安装程序中

[英]Visual Studio Publish Project Into One Simple Installer

I've got a sizable project, with multiple classes, 500+ images, and 20+ text files associated with said project. 我有一个相当大的项目,其中包含多个类,500多个图像和与该项目相关联的20多个文本文件。

I've been publishing my project via right clicking on the project->properties , and clicking on the publish tab. 我一直在通过右键单击project->properties ,然后单击publish选项卡来发布我的项目。 I've included the text files and images as resources already. 我已经包括了文本文件和图像作为resources

The issue is that whenever I install an application, usually it's a simple installer, ie you download an installer (one file such as installer.exe), run this file which then takes you through the setup, such as where to install it to, etc. Then the application is installed and that's it. 问题是,每当我安装一个应用程序时,通常是一个简单的安装程序,即下载一个安装程序(一个文件,如installer.exe),然后运行该文件,然后带您完成安装过程,例如将其安装到何处,等。然后安装该应用程序,仅此而已。

Well, when publishing my application, I specify an output directory, and I'm left with these files: 好了,在发布应用程序时,我指定了一个输出目录,并且剩下这些文件:

  • Application files 申请文件
  • MyProjectName.application (the manifest?) MyProjectName.application (清单?)
  • setup.exe SETUP.EXE

If I run setup.exe , I'm able to install the application and run it with no issues. 如果运行setup.exe ,则可以安装该应用程序并运行它而不会出现任何问题。 However, not only does it not let me choose where to install it, but I would have to send all 3 of these files to the user. 但是,它不仅不能让我选择安装位置,而且还必须将所有这三个文件发送给用户。 I tried to send just the setup.exe to a friend and it said they were missing the files required (which I'm assuming is what the application files and .application were for). 我试图只将setup.exe发送给朋友,它说他们缺少所需的文件(我假设这是application files.application的用途)。

How would I go about bunching these all into one installer, one that more closely matches how you would install an enterprise application (think of installing chrome, eclipse, photoshop, etc)? 我该如何将所有这些都捆绑到一个安装程序中,与您将如何安装企业应用程序(例如安装chrome,eclipse,photoshop等)更紧密地匹配?

I've love to be able to have one file which is the installer and be able to have users download that. 我非常希望能够拥有一个安装程序文件,并且能够让用户下载该文件。

Thank you 谢谢

The Ancients : If the below is TL;DR (too long, didn't read), please skim these two links: The Ancients :如果以下内容是TL;DR (太长,没有读过),请略过这两个链接:


UPDATE : September 2018 - Since this "answer" was recently downvoted, let me try to add some more links to see if the intent of the answer can be made more clear. 更新20189月 -由于此“答案”最近被否决,让我尝试添加更多链接以查看答案的意图是否可以更加清楚。 Not to be overly dramatic, but: 不要过于戏剧化,但是:

As deployment specialists we have to warn people when they commit to using a tool that is bound to fall apart for them down the line when more advanced deployment requirements invariably surface . As deployment specialists we have to warn people when they commit to using a tool that is bound to fall apart for them down the line when more advanced deployment requirements invariably surface

The installer projects have several times been pulled back and then re-introduced in Visual Studio . 安装程序项目已被撤回几次,然后重新引入Visual Studio中 Always based on the problems seen with these project types (just the bigger ones): 始终基于这些项目类型(只是较大的项目)中看到的问题:

1) No MSBuild support (not tested extensively by me, but by others), 2) only deferred mode custom actions running in system context (not insertable in GUI), 3) highly limited control overall (always advertised shortcuts, no ability to configure certain things, etc...), 4) no support for proper service installation - requires custom actions instead, 5) very few available prerequisites to bundle, 6) rudimentary GUI with little flexibility, 7) appears to not be possible to define MSI features (as in features and components), 8) problems with 32 / 64 bitness issues for custom actions , etc... 1)不支持MSBuild(未经我的广泛测试,但未经其他公司广泛测试); 2)仅在系统上下文中运行的延迟模式自定义操作(不可在GUI中插入); 3)总体上高度受限的控件(始终宣传快捷方式,无配置能力)某些事物,等等...), 4)不支持正确的服务安装-而是需要自定义操作, 5)捆绑的可用先决条件很少, 6)基本的GUI,灵活性差, 7)似乎无法定义MSI功能(如功能部件和组件), 8) 自定义操作等存在32/64位问题

An old MSDN page on this project types and its problems: Troubleshooting Setup and Deployment Projects . 有关该项目类型及其问题的旧的MSDN页面: 对安装和部署项目进行故障排除

MSI Expert Chris Painter and others: MSI专家Chris Painter和其他人:

In my opinion the project type can only work for simple.NET applications. 我认为项目类型仅适用于简单的.NET应用程序。 Any complexity of caliber and you are in trouble. 任何口径的复杂性都会给您带来麻烦。 SQL Scripts , IIS , proper COM / COM+ , Users & Groups , Shares , Firewall Rules , Custom GUI , etc... Commercial tools and WiX have advanced support for these things. SQL ScriptsIIS ,适当的COM / COM+Users & GroupsSharesFirewall RulesCustom GUI等。商业工具和WiX对这些功能具有高级支持。 The internals of the compiled MSI files are also sub-standard (use of self-registration, custom actions for services, etc...). 编译后的MSI文件的内部也是不合标准的(使用自注册,对服务的自定义操作等)。 I often experience that the tool stops working for "some unknown reason" as well. 我经常会遇到该工具由于“某些未知原因”而停止工作的情况。 Suddenly it won't compile. 突然,它将无法编译。 Concrete Example (with fix). 具体示例 (已修复)。

Alternatives : 替代方案

The open source WiX toolkit features a component called Burn to create such setup.exe launchers / downloaders / bootstrappers - used to run several installations in sequence and / or install prerequisites (a very common task - Visual Studio projects only support a few prerequisites). 开源WiX工具包具有一个称为Burn的组件,用于创建此类setup.exe启动器/下载器/引导程序-用于依次运行多个安装和/或安装先决条件(一个非常常见的任务-Visual Studio项目仅支持一些先决条件)。

Writing WiX XML markup code is necessary to use this Burn feature. 要使用此刻录功能,必须编写WiX XML标记代码。 Commercial tools Installshield and Advanced Installer provide GUI-features to build such setup.exe files. 商业工具InstallshieldAdvanced Installer提供了GUI功能来构建此类setup.exe文件。


The Visual Studio installer is very limited, I never use it. Visual Studio安装程序非常有限,我从未使用过。 WiX (link to an answer trying to provide some links for a WiX crash course) is a full blown, open source deployment solution. WiX (指向尝试为WiX速成课程提供一些链接的答案的链接)是成熟的开放源代码部署解决方案。 It will take you a while to master, but it is very good and flexible. 掌握它需要一些时间,但是它非常好且灵活。 A commercial solution such as Installshield or Advanced Installer will allow you to deliver a setup faster and easier, but they can be very pricey. 诸如InstallshieldAdvanced Installer之类的商业解决方案将使您可以更快,更轻松地交付设置,但它们的价格可能很高。

Given the limitations of Visual Studio Installer projects (and bugs), I do believe the right solution is to use a different tool: What installation product to use? 鉴于Visual Studio Installer项目的局限性(和错误),我相信正确的解决方案是使用其他工具:使用哪种安装产品? InstallShield, WiX, Wise, Advanced Installer, etc . InstallShield,WiX,Wise,Advanced Installer等 If you need anything advanced at all, you will struggle otherwise. 如果您根本不需要任何高级的东西,那么您将为否则而苦恼。 With a more advanced tool it is at least possible to do what you need, even if it might be more involved at times. 使用更高级的工具,即使有时可能涉及更多的工作,至少也可以做您需要的事情。

Let me know what you want to know about such a process, and I will try to help. 让我知道您想知道的有关此过程的信息,我将尽力提供帮助。 I am not sure what software you are delivering, what the target user group is, what budget you have, etc... Windows Installer is highly desirable for a number of corporate benefits , but other deployment technologies exist (see the description above of various tools to use). 我不确定要提供什么软件,目标用户群是什么,预算多少,等等。。。Windows Installer对于许多公司利益是非常可取的,但是还存在其他部署技术(请参见上面各种说明)使用工具)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM