macos - Codesign OSX 应用程序包,MacOS 目录名称中包含句点

标签 macos pyinstaller codesign app-bundle

我运行这一行:

codesign --verbose --force --deep --sign "Developer ID Application: Company" Company.app

我收到此错误:

Company.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/me/repo/client/Company.app/Contents/MacOS/include/python2.7

我已将问题范围缩小到以下事实:我有一个应用程序包,其中包含 Contents/MacOS 目录中的一些子目录,这些子目录的名称中包含句点。根据this ,codesign对此感到窒息,因为它认为任何带有句点的目录本身就是一个包并拒绝它(强调我的):

Note that a location where code is expected to reside cannot generally contain directories full of nested code, because those directories tend to be interpreted as bundles. So this occasional practice is not recommended and not officially supported. If you do do this, do not use periods in the directory names. The code signing machinery interprets directories with periods in their names as code bundles and will reject them if they don't conform to the expected code bundle layout.

我的包是由 PyInstaller 创建的(测试版本 3.1 和 3.2),并且目录会自动拉入。以下是所有存在此问题的目录:

Company.app/Contents/MacOS/include/python2.7
Company.app/Contents/MacOS/lib/python2.7
Company.app/Contents/MacOS/lib/python2.7/config
Company.app/Contents/MacOS/qt_menu.nib
Company.app/Contents/MacOS/tcl/http1.0
Company.app/Contents/MacOS/tcl/opt0.4

我看了here ,并且没有提到这个问题,我想知道是否有人有配置想法可以解决问题而不完全消除依赖项。

使用以下命令创建 bundle :

python $PYINSTALLER/pyinstaller.py \
-n $APP_NAME \
--paths $MODULE_SEARCH_PATH \
--windowed \
--icon $BUNDLEFILES_DIR/$APP_NAME.icns \
--distpath $BUNDLE_DIR/dist \
--osx-bundle-identifier com.company.$APP_NAME \
--exclude-module core.InternalTool \
main.py

最佳答案

我遇到了同样的问题,经过很多的失败,我终于可以让codesign工作了。我为此编写了一个配方,其中包含一个脚本来自动修复您的应用程序:Recipe OSX Code Signing Qt .

关于macos - Codesign OSX 应用程序包,MacOS 目录名称中包含句点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37737829/

相关文章:

python - PyQt Bloat 和 Pyinstaller

python - 如何通过 pyinstaller 安装带有 tkcalendar 模块的 python 应用程序?

cocoa - 如何获取代码签名的应用程序证书信息

python - 找不到 Pyinstaller 命令 (MacOS)

swift - 退出全屏NSView后恢复菜单栏

Python .exe 文件打开命令窗口

ios - 将.ipa从发行版转移到开发者资料

ios - 重新签名 iOS 应用程序 .iPA 文件而不更改 BundleId

macOS - 更新脚本 - 从 rsync 2.6.9 移动到 3.0.6

macos - cmake 从现有源生成 Xcode 项目