Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for how to freeze + needed changes to support it on Windows #6

Open
pushfoo opened this issue May 12, 2020 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@pushfoo
Copy link
Owner

pushfoo commented May 12, 2020

JGantts/Storyteller#1 uses a 200 mb dependency in addition to electron. They could use child_process or some sugar library to make this easier if pyc2e can be frozen. Python should be 15-20 mb, an order of magnitude less.

Try pyinstaller if cx_Freeze doesn't work, it doesn't restrict the things it bundles to the GPL .

@pushfoo
Copy link
Owner Author

pushfoo commented May 12, 2020

Freezing will need linux, windows, and mac executable versions.

@pushfoo pushfoo changed the title Explore freezing this as a temporary fix for story-teller's 200mb dependency Add instructions for how to freeze + needed changes to support it May 13, 2020
@pushfoo pushfoo changed the title Add instructions for how to freeze + needed changes to support it Add instructions for how to freeze + needed changes to support it on Windows May 13, 2020
@pushfoo
Copy link
Owner Author

pushfoo commented May 13, 2020

Preliminary freezing with pyinstaller seems to work. The caveat is that it doesn't like to run from a virtualenv in a mounted folder in virtualbox. Creating the virtualenv in the windows user's documents folder works as a fix. Afterward, runningpyinstaller D:\pyc2e\__main__.py works but creates a very messy folder.
The result appears to be ~12mb at time of writing.

@pushfoo pushfoo self-assigned this May 13, 2020
@pushfoo pushfoo added documentation Improvements or additions to documentation enhancement New feature or request labels May 13, 2020
@pushfoo
Copy link
Owner Author

pushfoo commented May 13, 2020

Shipping a single is strongly discouraged for admin mode programs by the pyinstaller documentation:

Do not give administrator privileges to a one-file executable (setuid root in Unix/Linux, or the “Run this program as an administrator” property in Windows 7). There is an unlikely but not impossible way in which a malicious attacker could corrupt one of the shared libraries in the temp folder while the bootloader is preparing it. Distribute a privileged program in one-folder mode instead.

Many users might run this admin mode. Not sure what the best way to proceed is. Need to find out how electron packages dependencies and subcomponents, and compare to cx_Freeze and other tools.
The big advantage of pyinstaller right now is that it doesn't require significant understanding of the framework. pyinstaller path\to\script.py works, even across drive boundaries.

@pushfoo pushfoo removed their assignment Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant