OSX bundles behavior changed after sign-ed by Apple's codesign utility

Issue #46 new
created an issue

I wrote a small and simple PyQt4 app on Mac OS X 10.9 Mavericks which stays on the system tray and monitors a service after launching. And i can interact with it's context menu using mouse click. (Click on the system tray icon --> then context menu pop-up)

I pack my OSX bundle using below command:

python setup.py bdist_mac --iconfile=myapp.icns

It is OK to run after i packed it as myapp.app bundle using cx_Freeze(4.3.2). But, once i signed it using the following command:

$ codesign --entitlements my-entitlements-file.plist -s "3rd Party Mac Developer Application: my-developer-id" myapp.app

After that, although i could still launch this osx bundle, but the context menu of it has gone! No matter how i click on the system tray icon, it just has no menu pop-up.

That means, the behavior of this osx bundle generated by cx_Freeze has been changed somehow.

You may ask why i run the above codesign command? Because before upload to Apple's Mac App Store, apps need to be signed & sandbox-ed by Apple's codesign utility. (Yes, that is a rule of Apple.)

I am not sure if its proper to report here. But i search a lot indeed, and program written in Python can not be signed in Xcode, so i have no idea how can i fix this, i am stuck for couple of days already. so please bear me. Thanks.

Comments (3)

  1. Dan McCombs

    Hmm - I codesign the app bundle generated by cx_Freeze and haven't run into any issues with it. That said, I'm signing for distribution outside the app store and my app is not sandboxed.

    I'm using PySide and the context menu on my tray icon works ok for me after signing.

    Perhaps it's related to the sandbox? As Thomas suggested, maybe that's removing a permission that your application needs.

    Can you try signing without the --entitlements option and see if your application works correctly? If it does, that would narrow it down to something in your entitlements, likely a resource restriction to do with the sandbox configuration.

  2. Dan McCombs

    @handsomegui I saw your comments via email on this issue and issue #45 but they aren't showing up on the web, so I'm not sure if you deleted them or not.

    As far as not getting a response on the mailing list, which mailing list did you post to? I haven't seen anything go by on the cx-freeze-users list.

    In any case, as far as Error -10810 goes, try running your executable inside your app bundle directly and see if you have any issues there. So instead of open myapp.app change directory to myapp.app/Contents/MacOS/ and try running your executable there with ./executable_name.

  3. Log in to comment