18

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. Silverlight's sandbox model will not work - it has to be a full-on downloaded, installed executable.

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.
  • I've developed applications using 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.
  • 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

Community
  • 1
  • 1
Rex M
  • 142,167
  • 33
  • 283
  • 313
  • (edited, the title wasn't very descriptive, forgot to comment) – jcollum Aug 03 '09 at 17:02
  • If you definitely don't want any window that is a different kettle of fish than the original question. I would point out that supplying a download link to a windows setup exe verses a mac app bundle is normal and people on both sides expect to have to download one or the other. therefore your real question is how to make said installer enforce (downloading if need be) the .Net runtimes and how to install as either a service/background task on the relative platforms... – ShuggyCoUk Aug 03 '09 at 17:22
  • @ShuggyCoUk good point. I don't expect to have a single download for both PC and Mac users. I think my question is not very clear - I believe there are some common issues which anyone who has developed installers for mass-distributed end-user app for both platforms would be aware of and know how to mitigate. I am interested in that. – Rex M Aug 03 '09 at 17:28

8 Answers8

14

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.

anthony
  • 40,424
  • 5
  • 55
  • 128
6

There is bitrock, which handles your target platforms but costs money

ShuggyCoUk
  • 36,004
  • 6
  • 77
  • 101
3

http://www.openlina.com/

They deliver on the build once, run anywhere promise.

Aneurysm9
  • 346
  • 2
  • 5
  • Very neat - I've never seen an OSS project that succeeds in this area. – Rex M Aug 26 '09 at 00:09
  • the website suggested that common installer was on their road map but not yet implemented unfortunately – ShuggyCoUk Aug 30 '09 at 07:21
  • My bad. When I talked with them at OSCON they demoed apps running in multiple environments and talked about single installer executables so I guess I just assumed they had implemented it. – Aneurysm9 Aug 31 '09 at 11:53
  • no worries - it got me looking into an interesting slant on VM tech thanks – ShuggyCoUk Sep 02 '09 at 00:24
2

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 3 allows your application to run outside of the browser on Windows and 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

Scott P
  • 3,775
  • 1
  • 24
  • 30
  • I need to setup this application to run on startup. It has a minimal GUI, runs more like a local service. I am not sure if Silverlight is the best tool for that. – Rex M Aug 03 '09 at 16:42
  • this is absolutely the best way to do it if the sandbox fits your needs. The sandbox will be maintained as cross platform for some time, thus aligning your desires with those of the platform maker's... – ShuggyCoUk Aug 03 '09 at 16:42
  • @ShuggyCoUk my research indicates out-of-browser Silverlight does not support running as a background process or out of the tray (e.g. windowless). Is this incorrect? – Rex M Aug 03 '09 at 16:49
  • Hmm, you might be able to set up a startup to go to the silverlight URL... still, not convinced this is right. – jcollum Aug 03 '09 at 16:54
  • no - the window remains so it sounds like the sandbox will be either very irritating or too limiting for your app. sorry :( – ShuggyCoUk Aug 03 '09 at 16:55
  • if you want to experiment then http://msdn.microsoft.com/en-us/magazine/dd882515.aspx is a good starting point. This will let you know if the isolation itself is too limiting for you (sounds like it might be) – ShuggyCoUk Aug 03 '09 at 16:56
  • @jcollum: A Windows Service on OS X? – John Saunders Aug 03 '09 at 17:13
  • @John: Indeed. Question is about Windows and OSX. In Windows a Service is a better solution than Silverlight (for the original iteration of the question) – jcollum Aug 03 '09 at 18:31
2

To create an installer there is:

  1. NSIS - Free
  2. InstallShield - Paid

I do not know how know about Macs

Issues: Computer does not have .Net Framework

Solution: StackOverflow - The State of Linkers for .NET apps

Community
  • 1
  • 1
Nick
  • 3,217
  • 5
  • 30
  • 42
2

You could try BitRock's InstallBuilder. From their website:

BitRock InstallBuilder is a development tool for building crossplatform installers for desktop and server software. 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.

Druid
  • 6,423
  • 4
  • 41
  • 56
0

What you want is 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. If you had X-windows, you got a GUI, if not a command line install. Windows installer worked with standard windows installer tech, and looked like a professional installer. It supports mac OS X as well. I highly recommend this software it does exactly what you want.

Byron Whitlock
  • 52,691
  • 28
  • 123
  • 168
0

As other posters mentioned, BitRock InstallBuilder supports your target platforms of Windows, Linux and 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. It is also used by other successful Mono-based ISVs like Codice Software

Daniel Lopez
  • 3,297
  • 2
  • 30
  • 29