From 87fc72a355208d1e7b75086e78591957ffcf0e03 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 9 Aug 2021 08:47:05 +0200 Subject: [PATCH] Build update --- README.md | 1 + TODO.md | 2 +- pyinstaller.py | 37 ++++++++++++++++++++++++------------- setup.py | 1 - 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e9c9974..5357be1 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ You can install them with Python's pip or your package manager if you're on linu ### PYINSTALLER BUILDING My preferred method of generating binary releases on Windows and Linux, MacOS doesn't seem to work for me. +NOTE: pyinstaller builds seem to get flagged as malware. ``python pyinstaller.py`` ### CX_FREEZE BUILDING diff --git a/TODO.md b/TODO.md index 096a680..d650e45 100644 --- a/TODO.md +++ b/TODO.md @@ -11,4 +11,4 @@ - Right click menu's color doesn't get updated on theme change in memos. - Closed windows sometimes stay open. - help() causes console to crash...? - - Themes sometimes don't get applied to trollslum. \ No newline at end of file + - Manual chumdroid sorting not working. \ No newline at end of file diff --git a/pyinstaller.py b/pyinstaller.py index 8d0dc9f..3728743 100644 --- a/pyinstaller.py +++ b/pyinstaller.py @@ -28,17 +28,25 @@ Some of the include files are specific to my instalation, so you might have to e shutil.rmtree('build') except FileNotFoundError as e: print(e) - - print("\nUPX corrupts DLLs when it feels like it, try disabling it if your build doesn't run.\nIf upx is on your path you don't need to include anything here.") - if is_64bit == True: - upx_dir = input("UPX directory [D:\\upx-3.96-win64]: ") - if upx_dir == '': - upx_dir = "D:\\upx-3.96-win64" # Default dir for me :) + print("UPX can decently reduce filesize but builds might get flagged by anti-viruses more often. (+ it sometimes breaks QT's DLLs)") + if input("Enable UPX? [N]: ").lower() == 'y': + upx_enabled = True else: - upx_dir = input("UPX directory [D:\\upx-3.96-win32]: ") - if upx_dir == '': - upx_dir = "D:\\upx-3.96-win32" # Default dir for me :) - print("upx_dir = " + upx_dir) + upx_enabled = False + + if upx_enabled == True: + print("If upx is on your path you don't need to include anything here.") + if is_64bit == True: + upx_dir = input("UPX directory [D:\\upx-3.96-win64]: ") + if upx_dir == '': + upx_dir = "D:\\upx-3.96-win64" # Default dir for me :) + else: + upx_dir = input("UPX directory [D:\\upx-3.96-win32]: ") + if upx_dir == '': + upx_dir = "D:\\upx-3.96-win32" # Default dir for me :) + print("upx_dir = " + upx_dir) + else: + upx_dir = '' if sys.platform == 'win32': print("\nUniversal CRT needs to be included if you don't want to run into compatibility issues when building on Windows 10. ( https://pyinstaller.readthedocs.io/en/stable/usage.html?highlight=sdk#windows )") if is_64bit == True: @@ -147,11 +155,14 @@ if sys.platform == 'win32': '--windowed', # Hide console #'--onefile', '--icon=pesterchum.ico', - #'--clean', # Clear cache + '--clean', # Clear cache ] - if os.path.isdir(upx_dir): - run_win32.append('--upx-dir=%s' % upx_dir) + if upx_enabled == True: + if os.path.isdir(upx_dir): + run_win32.append('--upx-dir=%s' % upx_dir) + else: + run_win32.append('--noupx') for x in upx_exclude: run_win32.append('--upx-exclude=%s' % x ) diff --git a/setup.py b/setup.py index a6c91df..484b19d 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,6 @@ includefiles = ["quirks", "PCskins.png", "Pesterchum.png"] build_exe_options = { - "includes": [""], ## "includes": ["PyQt5.QtCore", ## "PyQt5.QtGui", ## "PyQt5.QtWidgets",