2016-06-09 31 views
0

我跑這條線:協同設計OSX應用程序捆綁與MacOS的目錄名段

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,協同設計在這個扼流圈,因爲它認爲在這一段的任何目錄是一個包本身並拒絕接受(重點煤礦):

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,並有這個問題沒有提及,我想知道如果任何人有可能解決問題的配置思路沒有完全消除依賴從被包括在內。

束用下面的命令創建:

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 

回答

0

寫這整個問題之後,我注意到我們的構建腳本內部使得跟隨在Contents/MacOS的目錄下符號鏈接的應用程序的副本。

爲防萬一其他可憐的靈魂正在尋找類似的答案,解決方法是讓這些目錄存在於Contents/Resources目錄中,並從MacOS目錄中將它們符號鏈接到它們。