Visual Studio将项目发布到一个简单的安装程序中 [英] Visual Studio Publish Project Into One Simple Installer

查看:104
本文介绍了Visual Studio将项目发布到一个简单的安装程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的项目,其中包含多个类,500多个图像和与该项目相关联的20多个文本文件.

I've got a sizable project, with multiple classes, 500+ images, and 20+ text files associated with said project.

我一直通过右键单击project->properties,然后单击发布"选项卡来发布项目.我已经将文本文件和图像包含为resources.

I've been publishing my project via right clicking on the project->properties, and clicking on the publish tab. I've included the text files and images as resources already.

问题在于,每当我安装一个应用程序时,通常它是一个简单的安装程序,即您下载一个安装程序(一个文件,如installer.exe),然后运行此文件,该文件将带您完成安装过程,如安装位置.等等.然后就安装了应用程序.

The issue is that whenever I install an application, usually it's a simple installer, i.e. 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.

好吧,当发布我的应用程序时,我指定了一个输出目录,剩下了这些文件:

Well, when publishing my application, I specify an output directory, and I'm left with these files:

  • 应用程序文件
  • MyProjectName.application(清单?)
  • setup.exe
  • Application files
  • MyProjectName.application (the manifest?)
  • setup.exe

如果我运行setup.exe,则可以安装该应用程序并运行它而没有任何问题.但是,它不仅不能让我选择安装位置,而且还必须将所有这三个文件发送给用户.我试图只将setup.exe发送给一个朋友,它说他们缺少了所需的文件(我想这是application files.application的用途).

If I run setup.exe, I'm able to install the application and run it with no issues. 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).

我如何将所有这些都捆绑到一个安装程序中,与您将如何安装企业应用程序(例如安装chrome,eclipse,photoshop等)更紧密地匹配?

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)?

我非常希望能够拥有一个文件即安装程序,并且能够让用户下载该文件.

I've love to be able to have one file which is the installer and be able to have users download that.

谢谢

推荐答案

古人 :如果以下内容是 TL;DR (时间太长,没有读过),请略过这两个链接:

The Ancients: If the below is TL;DR (too long, didn't read), please skim these two links:

  • Troubleshooting Setup and Deployment Projects
  • Why use Windows Installer XML (WiX) over VDPROJ?


更新: 2018年9月-由于该答案"是最近被否决的,让我尝试添加更多链接以查看是否有 答案可以更清楚.不要太夸张,而是:

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. 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 .

安装程序项目已多次拉回,然后 在Visual Studio中重新引入.始终根据看到的问题 这些项目类型(只是较大的项目):

The installer projects have several times been pulled back and then re-introduced in Visual Studio. Always based on the problems seen with these project types (just the bigger ones):

1) 不支持MSBuild(未经我广泛测试,但受到其他公司的广泛测试), 2) 仅推迟了在系统上下文中运行的模式自定义操作(不可插入)在GUI中), 3) 总体上受高度限制的控制(总是广告快捷方式,无法配置某些东西,等等...), 4) 不支持适当的控制.服务安装-需要自定义操作, 5) 捆绑的可用先决条件很少, 6) 基本的GUI几乎没有灵活性, 7) 似乎无法定义MSI功能(如功能和组件中), 8) 问题与

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...

有关该项目类型及其问题的旧MSDN页面:

An old MSDN page on this project types and its problems: Troubleshooting Setup and Deployment Projects.

MSI专家Chris Painter和其他人:

MSI Expert Chris Painter and others:

在我看来,项目类型仅适用于简单的.NET应用程序.任何口径的复杂性都会给您带来麻烦. SQL ScriptsIIS,适当的COM / COM+Users & GroupsSharesFirewall RulesCustom GUI等....商业工具和WiX对这些内容具有高级支持.编译后的MSI文件的内部也是不合标准的(使用自注册,对服务的自定义操作等).我经常会遇到该工具由于某些未知原因"而停止工作的情况.突然,它将无法编译. 具体示例(已修复).

In my opinion the project type can only work for simple.NET applications. 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. The internals of the compiled MSI files are also sub-standard (use of self-registration, custom actions for services, etc...). I often experience that the tool stops working for "some unknown reason" as well. Suddenly it won't compile. Concrete Example (with fix).

替代品 :

Alternatives:

  • Simple List View of Deployment Tools
  • WiX Quick-Start Hints (if the tool needs to be free)

如何创建Windows Installer (链接到各种部署工具,MSI优势摘要和 趋势部署技术的一些简要说明)

How to create windows installer (links to all kinds of deployment tools, summary of MSI advantages and some brief descriptions of trending deployment technologies)

开放源代码WiX工具包具有一个名为 Burn 来创建这样的 setup.exe 启动器/下载器 /bootstrappers-用于依次运行多个安装和/ 或安装先决条件(一项非常常见的任务-Visual Studio项目 仅支持一些先决条件).

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 XML标记代码. 商业工具 Installshield

Writing WiX XML markup code is necessary to use this Burn feature. Commercial tools Installshield and Advanced Installer provide GUI-features to build such setup.exe files.


Visual Studio安装程序非常有限,我从未使用过. WiX (指向为WiX速成课程提供一些链接的答案的链接)是一个完整的开源部署解决方案.掌握它需要一些时间,但是它非常好且灵活.诸如 Installshield Advanced Installer 之类的商业解决方案将使您可以更快,更轻松地交付设置,但价格却非常昂贵.


The Visual Studio installer is very limited, I never use it. WiX (link to an answer trying to provide some links for a WiX crash course) is a full blown, open source deployment solution. 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.

鉴于Visual Studio Installer项目(和错误)的局限性,我相信正确的解决方案是使用其他工具: 要使用哪种安装产品? InstallShield,WiX,Wise,Advanced 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? InstallShield, WiX, Wise, Advanced Installer, etc. 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.

请让我知道您想知道的有关此过程的知识,我将尽力提供帮助.我不确定您要交付的软件,目标用户群是什么,预算是多少,等等... Windows Installer非常适合

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).

这篇关于Visual Studio将项目发布到一个简单的安装程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆