Notarized installer package build with Pyinstaller won't open due to javascript error

26 views
Skip to first unread message

Paul Fishback

unread,
May 18, 2022, 11:41:55 AM5/18/22
to PyInstaller
I'm using the most recent Pyinstaller on a Mac running OSX 12.3.1.

I have a simple "toy example"  .app built with tkinter and Pyinstaller that computes the determinant of a matrix. The .app works fine and I'm able to get it notarized by Apple and to open it on multiple machines.

Although it's not necessary for me to make a .pkg, I'd like to learn how to do so for purposes of more advanced examples. My general workflow is as follows:

1. Use .py and .spec files to create .app. My .spec file is given at the end of this message. 
2. Code sign .app, zip it, upload to Apple for notarization. Once it's notarized, I open it on my machine and someone else's to check.
3. Create package from .app using productbuild command.
4. Try to open package on my own machine before submitting to Apple for notarization.

At this stage, I encounter the javascript error message below:

Screen Shot 2022-05-18 at 10.10.06 AM.png

I should note that even though I can't open the .pkg, Apple still notarizes it! In addition, the notarization log doesn't yield any helpful information. 

I've tried to find the source of the problem by posting on the Apple Developer's forum. Responses were not overly helpful and placed the blame on Pyinstaller. (I should be using XCode said one individual!)

I'm wondering if anybody else has encountered problems of this type, specifically, creating an installer package from an app created using Pyinstaller?

Here's my .spec file:

# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['determinant_calculator.py'],
 pathex=['/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages','/Users/fishbacp/Desktop/determinants'],
  binaries=[],
  datas=[],
   hiddenimports=['tkinter','numpy','ast'],
   hookspath=[],
   runtime_hooks=[],
   excludes=[],
   win_no_prefer_redirects=False,
   win_private_assemblies=False,
   cipher=block_cipher,
   noarchive=False)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name='determinant_calculator',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          console=False )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               upx_exclude=[],
               name='determinant_calculator')

app = BUNDLE(coll,name='Determinant Calculator.app', icon='/Users/fishbacp/Desktop/determinants/determinants.icns',bundle_identifier=None,
info_plist={
        'CFBundleIdentifier': 'Determinant Calculator',
        'CFBundleName': 'Determinant Calculator',
       'CFBundleIconFile': 'determinants.icns',
        'CFBundleDisplayName': 'Determinant Calculator',
        'CFBundleShortVersionString':'v 0.1, Paul F',
        'LSEnvironment': {
            'LANG': 'de_DE.UTF-8',
            'LC_CTYPE': 'de_DE.UTF-8'
        }})


Reply all
Reply to author
Forward
0 new messages