简体   繁体   English

为可以在Windows和OS X上运行的.NET应用程序构建安装程序?

[英]Build an installer for .NET app that can run on Windows and OS X?

I am surprised I could not find this question already asked, so if I simply missed it please notify promptly. 我很惊讶我找不到这个问题,所以如果我错过了,请及时通知。

I need to write a very small, fairly simple application in .NET that will be downloaded by end-consumers and installed on their system. 我需要在.NET中编写一个非常小的,相当简单的应用程序,它将由最终消费者下载并安装在他们的系统上。 Silverlight's sandbox model will not work - it has to be a full-on downloaded, installed executable. Silverlight的沙盒模型不起作用 - 它必须是一个完整的下载,安装的可执行文件。

Here's what I know: 这就是我所知道的:

  • I've developed applications which run in a controlled desktop environment - for example, an IT app that runs on a hundred internal computers. 我开发了在受控桌面环境中运行的应用程序 - 例如,在一百台内部计算机上运行的IT应用程序。
  • I've developed applications using Mono 我使用Mono开发了应用程序

What I do not know: 我不知道的是:

  • How to create a flexible, robust installer that will work on a myriad of uncontrolled desktop configurations and environments. 如何创建灵活,强大的安装程序,可以在无数不受控制的桌面配置和环境中工作。
  • How to do the same with Mono targeted for Mac OSX. 如何使用针对Mac OSX的Mono进行相同操作。
  • What are the common issues in installing a widely-distributed end-user application and how to mitigate them? 安装广泛分布的最终用户应用程序以及如何减轻它们的常见问题是什么?

I am looking for the best resources to fill in my knowledge gaps . 我正在寻找最好的资源来填补我的知识空白

Related 有关

Equivalent of a Windows Service on OSX with Mono 使用Mono在OSX上等效的Windows服务

For Windows, consider Windows Installer XML (WiX) . 对于Windows,请考虑Windows Installer XML(WiX) For OSX, you need to generate a .app bundle. 对于OSX,您需要生成.app包。 Here is an example using the nant tasks included with the Monobjc project. 以下是使用Monobjc项目中包含的nant任务的示例

Here are some of the major issues you will face: 以下是您将面临的一些主要问题:

On Windows: 在Windows上:

  • Your installer will have to detect previous/old versions and close/uninstall/migrate as appropriate. 您的安装程序必须检测以前/旧版本并根据需要关闭/卸载/迁移。 Both NSIS and WiX have mechanisms for this. NSIS和WiX都有此机制。
  • Your installer/app will have to be compatible with different versions of Windows (XP, Vista, 7), and different versions of .NET (2.0, 3.0, 3.5 eventually). 您的安装程序/应用程序必须与不同版本的Windows(XP,Vista,7)和不同版本的.NET(最终为2.0,3.0,3.5)兼容。 Actually testing this is one of the more tedious tasks you face. 实际上测试这是你面临的一项比较繁琐的任务。 I strongly recommend having a handful of clean virtual machine images around for this. 我强烈建议您使用一些干净的虚拟机映像。

On OSX: 在OSX上:

  • You will most likely want to ship a standalone application bundle, meaning mono will be bundled within your .app. 您很可能希望发布一个独立的应用程序包,这意味着mono将捆绑在您的.app中。 This will add ~50mb to your distributable. 这将为您的distributable增加~50mb。
  • You will have to reference different versions of Monobjc to support OSX 10.4 and 10.5, you will need to configure your build to do this, as well as test both versions. 您必须引用不同版本的Monobjc来支持OSX 10.4和10.5,您需要配置构建来执行此操作,以及测试这两个版本。
  • Make sure that your c# code isn't using Windows/.NET specific calls by running the Mono Migration Analyzer (MoMA) on your codebase. 通过在代码库上运行Mono Migration Analyzer(MoMA) ,确保您的c#代码未使用Windows / .NET特定的调用。

Upgrading: 升级:

You haven't mentioned how you plan to offer upgrades. 您还没有提到计划如何提供升级。 NSIS and WiX have the capability to handle upgrades. NSIS和WiX有能力处理升级。 Make sure you have your build versioning scheme worked out before your deploy the initial version. 在部署初始版本之前,请确保已完成构建版本控制方案。 On OSX, Monobjc can integrate with Sparkle . 在OSX上,Monobjc可以与Sparkle集成。

有一个bitrock ,它处理你的目标平台,但需要花钱

http://www.openlina.com/ http://www.openlina.com/

They deliver on the build once, run anywhere promise. 他们提供一次构建,随处运行承诺。

This may or may not be the answer you are looking for. 这可能是您正在寻找的答案,也可能不是。 If your application can survive in the Silverlight sand box, you may want to explore Silverlight 3.0. 如果您的应用程序可以在Silverlight沙箱中存活,您可能想要探索Silverlight 3.0。

Silverlight 3 allows your application to run outside of the browser on Windows and Mac. Silverlight 3允许您的应用程序在Windows和Mac上的浏览器之外运行。

Here's an example of setting it up: http://www.silverlightshow.net/items/Silverlight-3-as-a-Desktop-Application-Out-of-Browser-Applications.aspx 以下是设置它的示例: http//www.silverlightshow.net/items/Silverlight-3-as-a-Desktop-Application-Out-of-Browser-Applications.aspx

To create an installer there is: 要创建安装程序,有:

  1. NSIS - Free NSIS - 免费
  2. InstallShield - Paid InstallShield - 付费

I do not know how know about Macs 我不知道怎么知道Macs

Issues: Computer does not have .Net Framework 问题:计算机没有.Net Framework

Solution: StackOverflow - The State of Linkers for .NET apps 解决方案: StackOverflow - 适用于.NET应用程序的连接器状态

You could try BitRock's InstallBuilder . 你可以试试BitRock的InstallBuilder From their website: 从他们的网站:

BitRock InstallBuilder is a development tool for building crossplatform installers for desktop and server software. BitRock InstallBuilder是一个开发工具,用于构建桌面和服务器软件的跨平台安装程序。 With InstallBuilder, you can quickly create professional installers for Linux, Windows, Mac OS X, Solaris and other platforms from a single project file and build environment. 使用InstallBuilder,您可以从单个项目文件和构建环境快速为Linux,Windows,Mac OS X,Solaris和其他平台创建专业安装程序。

What you want is InstallAnywhere . 你想要的是InstallAnywhere It allows you to target multiple platforms with one installer project. 它允许您使用一个安装程序项目定位多个平台。 It will help with dependencies and platform specific issues. 它将有助于依赖性和平台特定问题。

I've used it on LINUX/BSD/Windows deployment, and it worked beautifully. 我已经在LINUX / BSD / Windows部署上使用它,它工作得很漂亮。 If you had X-windows, you got a GUI, if not a command line install. 如果你有X-windows,你有一个GUI,如果不是命令行安装。 Windows installer worked with standard windows installer tech, and looked like a professional installer. Windows安装程序使用标准的Windows安装程序技术,看起来像一个专业的安装程序。 It supports mac OS X as well. 它也支持mac OS X. I highly recommend this software it does exactly what you want. 我强烈推荐这个软件,它完全符合您的要求。

As other posters mentioned, BitRock InstallBuilder supports your target platforms of Windows, Linux and Mac. 正如其他海报所提到的, BitRock InstallBuilder支持Windows,Linux和Mac的目标平台。 I want to add that it has been used by the Mono project itself for a while to distribute all-in-one binary installer for Mono runtime. 我想补充说,Mono项目本身已经使用了一段时间来为Mono运行时分发一体化二进制安装程序。 It is also used by other successful Mono-based ISVs like Codice Software 它也被其他成功的基于单声道的ISV(如Codice Software)使用

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

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