Base_library.zip - create installer without?

751 views
Skip to first unread message

Tim Grove

unread,
Sep 3, 2020, 7:33:55 AM9/3/20
to pyins...@googlegroups.com
I think when I used to create installers with cx_freeze there was a choice about whether or not to bundle the base libraries into a zipfile. Is there an option for this with Pyinstaller? Is it possible to create a one-directory installation without the base_library.zip? Thanks.

Tim

bwoodsend

unread,
Sep 3, 2020, 11:16:13 AM9/3/20
to PyInstaller

Use --debug=noarchive.


Tim Grove

unread,
Sep 8, 2020, 5:30:00 AM9/8/20
to pyins...@googlegroups.com
Actually, I said thank you too soon... This definitely does something different in the build; I'm assuming that 'noarchive' is referring to the stuff that is normally packed into the executable? I'm still left with 'base_library.zip' in the MacOS directory, which has been causing me some difficulty when it comes to code signing for Mac. My solution has been to walk through the app bundle with a python script, signing everything as I go. When I find a zipfile, I unpack it, sign everything inside and re-pack it, deleting the original zipfile. Then I can sign the app bundle as a whole. This seems to work, but somehow feels like overkill, but maybe not... Thanks anyway for your response.

Best regards,
Tim

On Thu, Sep 3, 2020 at 4:16 PM bwoodsend <bwoo...@gmail.com> wrote:

Use --debug=noarchive.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/08da3fa6-6d85-403f-a658-5b8da4cfa789n%40googlegroups.com.

bwoodsend

unread,
Sep 8, 2020, 6:08:54 AM9/8/20
to PyInstaller
I think you have to use the `--clean` option and possibly clear your build folder for the `--debug=noarchive` option to actually be used. Last time I used it I remember it needing some extra encouragement. But the scenario your describing is exactly what it's for - it should do what you want it to do.

I take it then that it is necessary to code-sign `.pyc` files on macOS? I see another headache on the horizon...

Timothy W. Grove

unread,
Sep 8, 2020, 12:35:26 PM9/8/20
to pyins...@googlegroups.com
On 08/09/2020 11:07, bwoodsend wrote:
I think you have to use the `--clean` option and possibly clear your build folder for the `--debug=noarchive` option to actually be used. Last time I used it I remember it needing some extra encouragement. But the scenario your describing is exactly what it's for - it should do what you want it to do.
Not quite working as expected.... Deleted build and dist directories, and ran the above with the --clean option. Now I get a load of .pyc files in the app's Resource folder with symlinks in the MacOS folder, AND a base_library.zip file in there as well!!! I've tried with both Pyinstaller 3.6 and 4.0. Oh well....


I take it then that it is necessary to code-sign `.pyc` files on macOS? I see another headache on the horizon...
Not absolutely certain, but my own head was aching so much that I just signed EVERYTHING!

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.

bwoodsend

unread,
Jan 2, 2021, 3:51:00 PM1/2/21
to PyInstaller
Hi Tim,

Did you ever managed to get your build signed? We're wanting to add a codesign feature to PyInstaller so that you don't have to dismantle your build, sign it then glue it back together. Or at least work out what to tell users when they ask us how to get it to work. But very few of us have access to macOS and none of us know what codesign magic needs to be done. Could you chip in your story?

Brénainn

Tim Grove

unread,
Jan 9, 2021, 5:32:59 AM1/9/21
to pyins...@googlegroups.com
I see that this issue is addressed in 4.1 (I'm using 4.0); I'll update tomorrow and give it a try. Thanks!

Tim

On Fri, 8 Jan 2021 19:31 Tim Grove, <tim_...@sil.org> wrote:
Yes, codesigning remains a mystery to me too, and even worse since they added 'notarizing' in Catalina. I've found an application which I use now for code signing and packaging which takes a lot of pain out of the process: App Wrapper (https://ohanaware.com/appwrapper/). It's not free, but I find it very useful.

Even when using App Wrapper, I still had an issue with 'base_library.zip' and code signing, but it appears that it should be located in the /Contents/Resources folder instead of /Contents/MacOS. I found this issue discussed at: https://github.com/pyinstaller/pyinstaller/issues/3550
[Solution]
If you move base_library.zip to Contents/Resources
Then provide a soft link:
cd Contents/MacOS
ln -s ./../Resources/base_library.zip base_library.zip

I used to employ a python script which walked through my app and signed absolutely every file! When it encountered the base_library.zip file, it would unzip it, sign every file inside, and then zip it again; then sign the zip file itself and then the app again. Absolute overkill, I'm sure, but I was a desperate man! Now, with the zip file located with the resources as described above, just normal code signing seems to work just fine.

Best regards,
Tim

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.

Tim Grove

unread,
Jan 9, 2021, 5:33:15 AM1/9/21
to pyins...@googlegroups.com
Yes, codesigning remains a mystery to me too, and even worse since they added 'notarizing' in Catalina. I've found an application which I use now for code signing and packaging which takes a lot of pain out of the process: App Wrapper (https://ohanaware.com/appwrapper/). It's not free, but I find it very useful.

Even when using App Wrapper, I still had an issue with 'base_library.zip' and code signing, but it appears that it should be located in the /Contents/Resources folder instead of /Contents/MacOS. I found this issue discussed at: https://github.com/pyinstaller/pyinstaller/issues/3550
[Solution]
If you move base_library.zip to Contents/Resources
Then provide a soft link:
cd Contents/MacOS
ln -s ./../Resources/base_library.zip base_library.zip

I used to employ a python script which walked through my app and signed absolutely every file! When it encountered the base_library.zip file, it would unzip it, sign every file inside, and then zip it again; then sign the zip file itself and then the app again. Absolute overkill, I'm sure, but I was a desperate man! Now, with the zip file located with the resources as described above, just normal code signing seems to work just fine.

Best regards,
Tim

On Sat, Jan 2, 2021 at 8:51 PM bwoodsend <bwoo...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.

Tim Grove

unread,
Jan 9, 2021, 6:51:47 PM1/9/21
to pyins...@googlegroups.com
Pyinstaller 4.1 works for me. Nice job, thanks!

Tim
Reply all
Reply to author
Forward
0 new messages