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

人气:181 发布:2022-10-16 标签: deployment desktop .net mono

问题描述

我很惊讶我找不到这个问题已经问过了,所以如果我只是错过了它,请及时通知.

I am surprised I could not find this question already asked, so if I simply missed it please notify promptly.

我需要用 .NET 编写一个非常小、相当简单的应用程序,最终消费者可以下载并安装到他们的系统上.Silverlight 的沙盒模型将不起作用 - 它必须是完整下载、安装的可执行文件.

I need to write a very small, fairly simple application in .NET that will be downloaded by end-consumers and installed on their system. Silverlight's sandbox model will not work - it has to be a full-on downloaded, installed executable.

这是我所知道的:

我开发了在受控桌面环境中运行的应用程序 - 例如,在一百台内部计算机上运行的 IT 应用程序.我使用 Mono 开发了应用程序

我不知道的:

如何创建一个灵活、强大的安装程序,可以在无数不受控制的桌面配置和环境中运行.如何对面向 Mac OSX 的 Mono 执行相同操作.安装广泛分布的最终用户应用程序的常见问题是什么?如何缓解这些问题?

我正在寻找最好的资源来填补我的知识空白.

与 Mono 的 OSX 上的 Windows 服务等效

推荐答案

对于 Windows,请考虑 Windows Installer XML (WiX).对于 OSX,您需要生成一个 .app 包.这是一个示例,使用 Monobjc 项目.

For Windows, consider Windows Installer XML (WiX). For OSX, you need to generate a .app bundle. Here is an example using the nant tasks included with the Monobjc project.

以下是您将面临的一些主要问题:

Here are some of the major issues you will face:

在 Windows 上:

On Windows:

您的安装程序必须检测以前/旧版本和关闭/卸载/迁移为合适的.NSIS 和 WiX 都有机制.您的安装程序/应用程序必须是兼容不同版本的Windows(XP、Vista、7)和不同的.NET 版本(2.0、3.0、3.5最终).实际上测试这是你最乏味的任务之一脸.我强烈建议有一个少数干净的虚拟机周围的图片.

在 OSX 上:

您很可能希望发布一个独立的应用程序包,这意味着 mono 将捆绑在您的 .app 中.这将为您的可分发文件增加约 50mb.您必须引用不同版本的 Monobjc 才能支持 OSX 10.4 和 10.5,您需要配置您的构建来执行此操作,并测试这两个版本.通过运行 Mono 迁移分析器,确保您的 c# 代码未使用 Windows/.NET 特定调用(MoMA) 在您的代码库中. You will most likely want to ship a standalone application bundle, meaning mono will be bundled within your .app. This will add ~50mb to your distributable. 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. Make sure that your c# code isn't using Windows/.NET specific calls by running the Mono Migration Analyzer (MoMA) on your codebase.

升级:

您尚未提及您计划如何提供升级.NSIS 和 WiX 具有处理升级的能力.确保在部署初始版本之前制定好构建版本控制方案.在 OSX 上,Monobjc 可以与 Sparkle 集成.

You haven't mentioned how you plan to offer upgrades. NSIS and WiX have the capability to handle upgrades. Make sure you have your build versioning scheme worked out before your deploy the initial version. On OSX, Monobjc can integrate with Sparkle.

729