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

Investigate using pyinstaller to create one-click installer #504

Open
4 tasks
jzohrab opened this issue Oct 30, 2024 · 4 comments
Open
4 tasks

Investigate using pyinstaller to create one-click installer #504

jzohrab opened this issue Oct 30, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@jzohrab
Copy link
Collaborator

jzohrab commented Oct 30, 2024

This is a tough one, perhaps :-) but it could be extremely useful for users who want to try Lute but are overwhelmed with the setup!

I've never used pyinstaller (or alternatives), so I don't know what's involved. But I feel off the bat that there are a few things that would need to be handled/investigated:

  • first, just get a simple one-click installer to run
  • figure out how to do different configurations for the installs. e.g., for me, I like to set up Lute to store different data in different locations. We can't/shouldn't assume that all users will want their data to go into the system/user preferences folder.
  • how to handle plugins, which are currently done with different pip installs
  • how to handle updates
@jzohrab jzohrab added the help wanted Extra attention is needed label Oct 30, 2024
@jzohrab jzohrab added this to Lute-v3 Oct 30, 2024
@cblanken
Copy link
Contributor

@jzohrab I'm gonna take a crack at this.

@jzohrab
Copy link
Collaborator Author

jzohrab commented Nov 21, 2024

Super @cblanken , thank you! Any progress is good.

@cblanken
Copy link
Contributor

cblanken commented Dec 16, 2024

@jzohrab Hey, probably won't be able to work much more on this at the moment. Got kinda busy. Here are my notes so far though in case anyone wants to pick up where I left off.

Lute Pyinstaller

Builds will need to be made on early versions as possible of the target
operating systems. Built executables are not backwards compatible, so that
probably implies at least one build for Windows 10 and 11 and the last couple
Mac versions as well.

Focus should probably be on Windows and Mac builds as anyone using Linux is
more likely to be comfortable with the regular installation process.

Forward compatibility

  • See here for Mac forward compatibility concerns.
  • See here for Windows forward compatibility concerns.

One-file or One-folder

Pyinstaller can bundle Lute into either a single folder (one-folder) or single executable (one-file). The one-file option will setup a temporary directory to operate on files. It would probably be best to specify the the runtime temp dir, otherwise you run into the risk of the operating system periodically deleting Lute files from the system created temp directory.

The --runtime-tmpdir option can do this but it will mean user's will need to manage a folder of lute config/data files anyway, so the one-folder option may be preferable. That way releases can just be a zipped archive of the build folder.

Adding Lute data to the build

One option is to copy the entire lute directory from the base folder. This may make the binary larger than it needs to be since it packages all the source code where it shouldn't really be needed.

Normally, it should be possible to only copy over the static and templates directories. It seems like Lute uses some imports via the local filesystem which seems to break some of the packaging done by Pyinstaller.

GUI installer?

I'm not sure this is possible without packaging system dependent packages like
Qt for Linux.

Simple build

  • Add pyinstaller to the dev deps.
  • Test build with this build script
pyinstaller \
    --console \
    --onefile \
    --add-data "lute:lute" \
    --runtime-tmpdir "mylute" \
    lute/main.py

This build script worked fine for me on Linux, but it could definitely be optimized to not require adding the entire lute directory and there may need to be some adjustments for Windows and Mac builds.

@jzohrab
Copy link
Collaborator Author

jzohrab commented Dec 16, 2024

Hi @cblanken -- thank you very much for your time and the great write-up, really appreciated! It's a bigger problem to solve than it first seems.

I think I'll reach out to the team at Anki and see if they can offer additional guidance -- but in the meantime, I'll leave this in the backlog. Cheers!

@jzohrab jzohrab pinned this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: No status
Development

No branches or pull requests

2 participants