diff --git a/build/win/DemonEditor.spec b/build/win/DemonEditor.spec index f6ca6fe6..74535f20 100644 --- a/build/win/DemonEditor.spec +++ b/build/win/DemonEditor.spec @@ -7,8 +7,7 @@ PATH_EXE = [os.path.join(DIR_PATH, EXE_NAME)] block_cipher = None -excludes = ['app.tools.mpv', - 'gi.repository.Gst', +excludes = ['gi.repository.Gst', 'gi.repository.GstBase', 'gi.repository.GstVideo', 'youtube_dl', @@ -48,9 +47,19 @@ a = Analysis([EXE_NAME], win_private_assemblies=False, cipher=block_cipher, noarchive=False) + + pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + + +splash = Splash('logo.png', + binaries=a.binaries, + datas=a.datas) + + exe = EXE(pyz, + splash, a.scripts, [], exclude_binaries=True, @@ -59,13 +68,16 @@ exe = EXE(pyz, bootloader_ignore_signals=False, contents_directory='.', strip=False, - upx=True, + upx=False, console=False, icon='icon.ico') + + coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, + splash.binaries, strip=False, upx=True, upx_exclude=[], diff --git a/build/win/logo.png b/build/win/logo.png new file mode 100644 index 00000000..6c858b43 Binary files /dev/null and b/build/win/logo.png differ diff --git a/build/win/start.py b/build/win/start.py index 6fd78698..94ae8b6a 100644 --- a/build/win/start.py +++ b/build/win/start.py @@ -1,14 +1,20 @@ #!/usr/bin/env python3 -import os -import ssl +import sys if __name__ == "__main__": - from multiprocessing import freeze_support + if hasattr(sys, "_MEIPASS"): + import os + import pyi_splash + import ssl + from multiprocessing import freeze_support + + os.environ["PYTHONUTF8"] = "1" + # TODO There needs to be a more "correct" way. + ssl._create_default_https_context = ssl._create_unverified_context + + freeze_support() + pyi_splash.close() + from app.ui.main import start_app - os.environ["PYTHONUTF8"] = "1" - # TODO There needs to be a more "correct" way. - ssl._create_default_https_context = ssl._create_unverified_context - - freeze_support() start_app()