【发布时间】:2012-08-17 20:31:13
【问题描述】:
如果您访问/usr/bin,您将看到数百个可执行文件或可执行文件的链接。
我的应用程序(在 Xcode 中用 Obj-C 编写的 Mac 应用程序)依赖于其中一些可执行文件。不幸的是,必须手动安装可执行文件 - 我必须检查它们,然后提示用户安装它们。
我的代码是:
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/executable"];
NSPipe *pipe = [NSPipe pipe];
[task setStandardOutput:pipe];
NSFileHandle *file = [pipe fileHandleForReading];
[task setArguments:[NSArray arrayWithObjects:sender, target, nil]];
[task launch];
我想知道是否可以将我的应用程序中的可执行文件复制到某个地方,然后从那里调用它。这样,用户就不必自己去获取它。
Mac App Store 会允许吗?
【问题讨论】:
-
一般来说,只需在构建时将它们作为应用程序包的一部分就可以了。不幸的是,我对问题的应用商店部分一无所知。
-
@Lvsti 你到底是什么意思?如,我应该在哪里添加可执行文件?我将如何“在构建时使它们成为应用程序包的一部分”?我该怎么称呼它 -
setPathLaunch是什么? -
我怀疑应用商店不允许允许此类恶作剧,因为沙盒可能不允许启动外部任务。 Other people have been thinking about this question as well.
标签: objective-c macos embed executable mac-app-store