From 3497652e4145119685bd5ada34f3890f8c8dea98 Mon Sep 17 00:00:00 2001 From: RoliSoft Date: Sat, 22 Oct 2016 22:44:17 +0300 Subject: [PATCH] Added experimental PyInstaller spec. --- pyinstaller.spec | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pyinstaller.spec diff --git a/pyinstaller.spec b/pyinstaller.spec new file mode 100644 index 0000000..9760c61 --- /dev/null +++ b/pyinstaller.spec @@ -0,0 +1,30 @@ +# -*- mode: python -*- +# +# Compiles the .py files into .exe using PyInstaller. +# Run with: pyinstaller --noconfirm --clean pyinstaller.spec +# + +from os import system + +files = ['get-source', 'get-prebuilt', 'install', 'switch'] + +for file in files: + binaries = None + + if file == 'install': + binaries = [('ntfsea_x86.dll', '.'),('ntfsea_x64.dll', '.')] + + a = Analysis([file + '.py'], pathex=['.'], binaries=binaries, datas=None, hiddenimports=[], hookspath=[], runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=None) + pyz = PYZ(a.pure, a.zipped_data, cipher=None) + exe = EXE(pyz, a.scripts, exclude_binaries=True, name=file, debug=False, strip=False, upx=True, icon=None, console=True) + col = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, icon=None, name=file) + +for file in files: + if file == 'switch': + continue + + system('xcopy dist\\' + file + '\\* dist\\switch /e /d /y /h /r /c') + system('rmdir /s /q dist\\' + file) + +system('xcopy C:\\Windows\\System32\\vcruntime140.dll dist\\switch\\vcruntime140.dll /y') +system('move dist\\switch dist\\wsl-distrib-switcher')