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

前端 未结 8 1626
暗喜
暗喜 2021-02-07 06:09

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 .

8条回答
  •  故里飘歌
    2021-02-07 07:00

    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:

    On Windows:

    • Your installer will have to detect previous/old versions and close/uninstall/migrate as appropriate. Both NSIS and WiX have mechanisms for this.
    • 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). 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:

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

    Upgrading:

    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.

提交回复
热议问题