gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 23:06:45 25 4
gpt4 key购买 nike

我有一个相当大的项目,有多个类、500 多张图片和 20 多个与该项目相关的文本文件。

我一直通过右键单击 project->properties 并单击发布选项卡来发布我的项目。我已经将文本文件和图像作为资源包含在内。

问题是每当我安装一个应用程序时,它通常是一个简单的安装程序,即您下载一个安装程序(一个文件,例如 installer.exe),然后运行该文件,它会引导您完成设置,例如安装位置等等。然后安装应用程序,仅此而已。

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

  • 申请文件
  • MyProjectName.application( list ?)
  • 安装程序.exe

如果我运行 setup.exe,我就可以安装并运行该应用程序而不会出现任何问题。但是,它不仅不允许我选择安装位置,而且我还必须将这 3 个文件全部发送给用户。我试图只将 setup.exe 发送给 friend ,它说他们缺少所需的文件(我假设是 application files .application 是为了)。

我如何将这些全部整合到一个安装程序中,一个更符合您安装企业应用程序的方式(想想安装 chrome、eclipse、photoshop 等)的安装程序?

我很高兴能够拥有一个安装程序文件,并且能够让用户下载它。

谢谢

最佳答案

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


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.

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

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

MSI Expert Chris Painter and others:

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:

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

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 速成类(class)提供一些链接的答案)是一个成熟的开源部署解决方案。掌握它需要一段时间,但它非常好且灵活。 InstallshieldAdvanced Installer 等商业解决方案可让您更快、更轻松地交付设置,但它们可能非常昂贵。

鉴于 Visual Studio Installer 项目(和错误)的局限性,我相信正确的解决方案是使用不同的工具: What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc .如果你需要任何先进的东西,否则你会很挣扎。使用更高级的工具,至少可以做您需要的事情,即使有时可能涉及更多。

让我知道您想了解的有关此类过程的信息,我会尽力提供帮助。我不确定您提供的是什么软件、目标用户群是什么、您有多少预算等等……Windows Installer 非常适合 a number of corporate benefits ,但存在其他部署技术(请参阅上面对要使用的各种工具的描述)。

关于c# - Visual Studio 将项目发布到一个简单的安装程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47936435/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com