-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added experimental PyInstaller spec.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |