views:

510

answers:

2

I'll be writing a small desktop app for a client that has WinXP machines and they won't be installing the .NET framework (at least not for me).

So my choices are limited to either C++ or VB6, neither of which sound great. I remember reading back in the day that Mono came up with a static compiler, but recently the only thing I could find is Miguel de Icaza's entry on static compilation for a game engine for the purposes of running the app on the iPhone - not what I had in mind.

Are there any products out there, free or commercial that will allow me to statically compile my .net 3.5 winform app?

Thanks

+10  A: 

You can try to use Remotesoft Salamander.

It does exactly what you want.

Reed Copsey
...for a very big overprice...
Camilo Martin
+4  A: 

Mono has vastly improved its support for Ahead of Time compilation (AOT) to the point where, assuming you are willing/able to target Mono rather than the .Net runtime, it should be possible to statically compile virtually any CIL application.

Whether or not that is a good idea overall depends entirely on the application and your constraints.

For example, Novell now ships MonoTouch, a CLI implementation which is fully AOT compiled and linked to allow .Net applications (not just games) to run on the iPhone against the CocoaTouch framework.

Those same AOT techniques can be used to compile a Winforms application which would not require either the .Net or Mono runtime as prerequisites. There are a lot of performance tradeoffs (both positive and negative) related to AOT, so I would not move forward without due diligence.


Edit:

In response to John Saunders' question regarding "why not just install it for them?". That actually brings up one reason why you might need AOT compilation.. Bootstrappers.

In order to install anything, you have to run an executable. You can either distribute an MSI (which will launch msiexec.exe implicitly) or you can distribute an exe. MSI, while functional, is a pretty terrible developer experience. So you could build your bootstrapper using .NET (AOT compiled eliminate the runtime dependency) which installs whatever prerequisites are necessary (such as .NET) before installing your app.

Additionally, some companies may need to ship downloadable executables that don't require users to install anything (silently or otherwise).

Yet another: Installing .NET requires administrative privileges. AOT may allow you to get around that requirement for your application.

Again, whether any of that is a good idea depends entirely on the application and on your constraints.

hemp
+1 Your answer was very constructive!
Camilo Martin