[Mono-osx] Mac OS X Embedding Mono.

Alexander Shulgin alexander.shulgin at yessoftware.com
Wed Sep 1 07:37:37 EDT 2010


On 01.09.2010 10:05, Luis Ramirez wrote:
> I am trying to distribute a Mac OS X application that requires mono. At
> first I tried to use mkbundle and macpack and recursively link the the
> dylibs by using otool. This almost works except for the application
> failing due to the fact that libgdiplus.dylib is loaded at runtime by
> System.Drawing assembly. I then attempted to modify the file
> System.Drawing.dll.config to modify the path the application searches
> for libgdiplus.dylib. The weird thing is that the application still
> fails because it can not load libgdiplus.dylib, but the path that it
> shows in the error is the path that I set in the System.Drawing.dll.config.
>
> I found this
> http://mono.1490590.n4.nabble.com/Redistributable-Mac-OSX-app-without-mono-using-mkbundle2-tp2216423.html
> but It does not seem to have been resolved.

What I proposed in that thread works for me.  Topic starter didn't 
reply, but that doesn't mean that it's not resolved.  Go try it yourself!

To summarize in short:

1. Hack System.Drawing.dll.config removing hard-coded libgdiplus.dylib path.

2. Bundle with mkbundle2.

3. Adjust distributed dylibs using install_name_tool utility to replace 
hard-coded `/Library/Frameworks/Mono.framework/...' with `@loader_path'.

4. Copy hacked dylibs alongside with the bundle to 
YourApp.app/Contents/MacOS.

--
Alex


More information about the Mono-osx mailing list