Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mono on MAC OS X El Capitan: LSOpenURLsWithRole

Tags:

c#

macos

mono

I have a .NET software which is running on Mono on both Linux and MAC. The software was packed as .app with Macpack on Mono 3.6.0 under OSX Lion and created an installer with PackageMaker. It worked fine on all new versions of OSX up until El Capitan which triggers the following error:

LSOpenURLsWithRole() failed with error -10810 for the file .../Applications/MyApp.app

I've moved the development files on El Capitan and managed to pack it with Macpack from Mono 4.0.4.4. It doesn't seem to show that error when using

open -a MyApp.app

The only problem now is that it doesn't start on double-click. The software is installed in /Applications by the installer. It starts fine from console with open command but not on double-click. Is there a way I can see an error or something by emulating the double-click from console ?

PS. Also on El Capitan the only Mono framework that seems to work is the latest 4.0.4.4 or the one designed for El Capitan, 4.2.1. The new location for the binaries are in /usr/local/bin instead of /usr/bin and this works only if /usr/local/bin exists prior to installation, otherwise mono command won't be recognized.

Thanks

like image 846
Daniel Bogdan Avatar asked Dec 08 '25 22:12

Daniel Bogdan


1 Answers

Same problem here (El Capitan). Thats how I solved (Mono 4.2.1)

1) Create an empty script and replace the one created by macpack (ex: KeePass.app/Contents/MacOS/KeePass)

2) Use full path for mono and for the exe file

#!/bin/sh
DIR=$(cd "$(dirname "$0")"; pwd) 
/usr/local/bin/mono $DIR/../Resources/KeePass.exe

I think thats somehow related to system-integrity-protection (csrutil) but not sure.

like image 176
rcruzs00 Avatar answered Dec 10 '25 12:12

rcruzs00



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!