Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundling the Windows Mono runtime with an application

Tags:

windows

mono

Regarding my earlier question about the Point of Mono on Windows, let's say that I develop an app against the windows mono runtime so that it will also run on Linux, OSX, etc.. and to make it more complicated, I use GTK# so that I don't have to deal with WinForms. Is there then an easy way to bundle the Windows Mono runtimes with my Windows version of the application so that it can all be installed at once? Or, is there no point to this? Once I develop against the Windows Mono runtime, would it still run fine against the MS .NET runtime? (I assume I would still need GTK# installed though).

like image 782
Adam Haile Avatar asked Apr 15 '09 13:04

Adam Haile


People also ask

What kind of runtime is provided by Mono for compilation?

The Mono runtime contains a code execution engine that translates ECMA CIL byte codes into native code and supports a number of processors: ARM, MIPS (in 32-bit mode only), SPARC, PowerPC, S390 (in 64-bit mode), x86, x86-64 and IA-64 for 64-bit modes.

What is Mkbundle?

mkbundle generates an executable program that will contain static copies of the assemblies listed on the command line. By default only the assemblies specified in the command line will be included in the bundle. To automatically include all of the dependencies referenced, use the "--deps" command line option.

Is Mono a VM?

The Mono runtime implements the ECMA Common Language Infrastructure (CLI). The Mono runtime implements this virtual machine.


1 Answers

The short answer is Yes.

The things you should take care about while programming are

  1. Not to use platform API
  2. Don't hardcode directory & file name separators, i.e. don't hardcode file paths, but use appropraite class to obtain path separator then concat the names.
  3. Keep in mind that file names on *nx are case sensitve and on Windows are not. While programming don't refer to the same file as log.txt and Log.txt but keep it all small.

Other then that, if you created GTK# application on *nx system, you will be able to run it on Windows if you installed GTK# assembly, and vice-versa.

I did this myself, and it worked like expected. I had a problem to find specific assembly dll version of GTK# on Windows and that took me few hours.

like image 84
majkinetor Avatar answered Nov 12 '22 02:11

majkinetor