Polprzewodnikowy / SummerCart64

SummerCart64 - a fully open source N64 flashcart
https://summercart64.dev
GNU General Public License v3.0
405 stars 22 forks source link

Feature request: Use pyinstaller for stand alone app. #28

Closed networkfusion closed 1 year ago

networkfusion commented 1 year ago

Expected Behavior

Ease of use for average user.

Current Behavior

Requires python and dependencies to be installed.

Possible Solution

Installing python should not really be required for the average user, so let's generate a standalone application as part of the release process... at least for the loader.

Steps to Reproduce

1. 2. 3. 4.

Context (Environment)

Mainly a windows environment.

Detailed Description

Possible Implementation

Use something like pyinstaller.

Polprzewodnikowy commented 1 year ago

I've added workflow job for that feature in this PR: https://github.com/Polprzewodnikowy/SummerCart64/pull/29. It definitely needs some more work. I've used --onefile parameter but macOS executable takes several seconds to load and print any output. Windows and Linux executables seems to have roughly one second delay. Documentation also needs to be adjusted if we want users to download precompiled apps instead of using python script direcly.

networkfusion commented 1 year ago

Nice work. I have been digging a little deeper (with only mobile access) and an alternative might be to use https://github.com/Nuitka/Nuitka instead of pyinstaller, although not sure if it will be any better.

networkfusion commented 1 year ago

Or a possible fix could be https://github.com/pyinstaller/pyinstaller/issues/2550 but at this point I am only speculating. I can help from tues onwards.

Polprzewodnikowy commented 1 year ago

Fiddled a little bit with parameters and it's pretty quick on Windows and Linux. App starts and it's operational in less than half a second. macOS build on other hand requires 2-4 seconds to print anything at all. I don't think this is a big issue because python3 is preinstalled in macOS so user don't have to install it separately. Only additional step is installing requirements in that case.

networkfusion commented 1 year ago

Interestingly Windows Defender thinks that the generated sc64.exe contains a trojan!. I will fork the branch and see if I can work out why. Also, it seems to take at least a couple of seconds to load, so I will see if I can improve that as well.

(for my own ref: https://stackoverflow.com/questions/43777106/program-made-with-pyinstaller-now-seen-as-a-trojan-horse-by-avg)

Polprzewodnikowy commented 1 year ago

Building pyinstaller bootloader separately seems to fix the issue with false virus detection. I ran tests on VirusTotal with file built from latest action on pyinstaller branch and zero threats were detected. macOS build still has issue with very long bootup time that needs further investigation. Documentation also should be adjusted to point the user to download precompiled binaries.

networkfusion commented 1 year ago

I have also been playing with this here: https://github.com/networkfusion/SummerCollection/tree/nuitka But.. got distracted by the menu 😜

Polprzewodnikowy commented 1 year ago

Fixed in https://github.com/Polprzewodnikowy/SummerCart64/commit/5b2ee0b6a1188166afc1dd57bb1a886841b354e3