2
我正尝试构建一个简单的应用程序,通过简单的双击即可由最终用户启动。修改Info.plist以启动应用程序
这里是文件夹树我有:
MyProgram.app/
Contents/
Info.plist
MacOS/
exe_not_exe --> this is a dummy exe, but needed
MyProgram-mac-os-x86_64/
MyProgram.app/ ---> THIS APP is executable
Contents/
Info.plist
MacOS/
exe_really_exe --> this is the exe really executed
我想,当用户双击第一MyProgram.app,应用程序启动,但实际上exe_really_exe
,不exe_not_exe
使用。
第一Info.plist中有某个关键:
<key>CFBundleExecutable</key>
<string>exe_not_exe</string>
所以我试图建立这种树文件夹而不是:
MyProgram.app/
Contents/
Info.plist
MacOS/
exe_not_exe
launcher --> this is a new file
MyProgram-mac-os-x86_64/
MyProgram.app/
Contents/
Info.plist
MacOS/
exe_really_exe
而在launcher
文件:
#!/usr/bin/env bash
open ../../MyProgram-mac-os-x86_64/MyProgram.app
open ../../MyProgram-mac-os-x86_64/MyProgram.app/MacOS/exe_really_exe
(我尝试了两条不同的指令)。如果我从其目录中启动launcher
文件,则所有内容均按预期工作。
我修改Info.plist中(在一个最高的树):
<key>CFBundleExecutable</key>
<string>launcher</string>
但最后,如果我双击MyProgram.app(一树高),应用程序没有按”开始。如果我从命令行启动它,我得到错误:
LSOpenURLsWithRole() failed with error -10810 for the file MyProgram.app/
你能帮我找出我的程序有什么问题吗?