简体   繁体   English

MAC OS X上的单声道El Capitan:LSOpenURLsWithRole

[英]Mono on MAC OS X El Capitan: LSOpenURLsWithRole

I have a .NET software which is running on Mono on both Linux and MAC. 我有一个.NET软件,它在Linux和MAC上运行在Mono上。 The software was packed as .app with Macpack on Mono 3.6.0 under OSX Lion and created an installer with PackageMaker. 该软件在OSX Lion下以Mono 3.6.0的Macpack打包为.app,并使用PackageMaker创建了一个安装程序。 It worked fine on all new versions of OSX up until El Capitan which triggers the following error: 它在所有新版本的OSX上工作正常,直到El Capitan触发以下错误:

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 . 我搬到上埃尔卡皮坦发展文件和管理从单声道4.0.4.4Macpack收拾它。 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. 该软件由安装程序安装在/ Applications中。 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. 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. 同样在El Capitan上,唯一可行的Mono框架是最新的4.0.4.4或为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. 二进制文件的新位置位于/ usr / local / bin而不是/ usr / bin,这仅在安装前存在/ usr / local / bin时才有效,否则将无法识别mono命令。

Thanks 谢谢

Same problem here (El Capitan). 同样的问题(El Capitan)。 Thats how I solved (Mono 4.2.1) 多数民众赞成我如何解决(Mono 4.2.1)

1) Create an empty script and replace the one created by macpack (ex: KeePass.app/Contents/MacOS/KeePass) 1)创建一个空脚本并替换macpack创建的脚本(例如:KeePass.app/Contents/MacOS/KeePass)

2) Use full path for mono and for the exe file 2)使用mono和exe文件的完整路径

#!/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. 我认为这在某种程度上与系统完整性保护(csrutil)有关但不确定。

LSOpenURLsWithRole() failed with error -10810 for the file .../Applications/MyApp.app LSOpenURLsWithRole()因文件错误-10810而失败... / Applications / MyApp.app

Sounds like it might be permissions issue, but -10810 can mean a lot of things and I never have seen a response to that error number that is definitive as to its original (it has been around since PowerPC days). 听起来它可能是权限问题,但-10810可能意味着很多事情,我从来没有看到对该错误号的回应,这个错误号对于它的原始错误(它自PowerPC时代以来一直存在)。 Permissions, external drive access and the actual Launch Services daemons have been pointed to. 已指出权限,外部驱动器访问和实际的启动服务守护程序。

  • Reboot (or manually kill and respawn those services, including Finder/Spotlight) 重启(或手动杀死并重新生成这些服务,包括Finder / Spotlight)
  • ls -l /Application/YourApp.app and check that is flagged as executable ls -l /Application/YourApp.app并检查是否标记为可执行文件
  • ls -l /Application/YourApp.app/Contents/MacOS/YourApp and check that is flagged as executable ls -l /Application/YourApp.app/Contents/MacOS/YourApp并检查是否标记为可执行文件
  • Open Console.app and retry double-clicking your app and review warnings/errors that are logged. 打开Console.app并重试双击您的应用程序并查看记录的警告/错误。
  • ... ...

Moving to El Capitan? 搬到El Capitan? Then you need Mono version 4.2.x or 4.0.4.4. 然后你需要Mono版本4.2.x或4.0.4.4。

From the Mono mailing list: 来自Mono邮件列表:

What is the difference between the latest Mono 4.0.4.4 package for Mac and the 4.2.1 El Capitan Preview? Mac的最新Mono 4.0.4.4软件包和4.2.1 El Capitan Preview有什么区别? The changelog of 4.0.4.4 includes “33585: El Capitan System Integrity Protection support.” so i suppose that the 4.0.4.4 also works on El Capitan?. 更改日志4.0.4.4包括“33585:El Capitan系统完整性保护支持。”所以我认为4.0.4.4也适用于El Capitan?。

Reply from Miguel de Icaza: Miguel de Icaza的回复:

One is based on Mono 4.0 series, with minimal changes just to enable the support on El Capitan; 一个基于Mono 4.0系列,只需进行少量更改即可获得El Capitan的支持; The 4.2 has the same changes, on top of the latest Mono 4.2, available on Alpha and the release candidate. 除了最新的Mono 4.2之外,4.2还有相同的变化,可在Alpha和候选版本上找到。

Ref: http://sushihangover.github.io/osx-10-dot-11-el-capitan-which-mono-version/ 参考: http//sushihangover.github.io/osx-10-dot-11-el-capitan-which-mono-version/

Since there is no fix yet you can use this temporary fix. 由于尚无修复,您可以使用此临时修复。 After packing with macpack open the app folder and go to /Contents/MacOS and edit the last if else from your launch script: 使用macpack打包后打开app文件夹并转到/ Contents / MacOS并从启动脚本编辑最后一个if else:

MONO_PATH="/usr/bin/mono"

cd "$APP_PATH/Contents/Resources"

if [ "$X11_MODE" -eq "1" ]; then
        open-x11 "$APP_NAME"
else
        if [ -f "/usr/local/bin/mono" ]; then MONO_PATH="/usr/local/bin/mono" ; fi
        "$MONO_PATH" "$ASSEMBLY"
fi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM