From c2c699a1d5d4bfd97d97e91fffdb9ba66f54668b Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Wed, 15 Feb 2017 00:00:33 +0100 Subject: [PATCH] Add a PyInstaller spec to exclude system DLLs. --- scripts/build-exe.cmd | 2 +- scripts/dosage.spec | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 scripts/dosage.spec diff --git a/scripts/build-exe.cmd b/scripts/build-exe.cmd index 18500ad17..e6bba85b1 100644 --- a/scripts/build-exe.cmd +++ b/scripts/build-exe.cmd @@ -1 +1 @@ -pyinstaller -y --onefile --additional-hooks-dir=. ../dosage +py -m PyInstaller -y dosage.spec diff --git a/scripts/dosage.spec b/scripts/dosage.spec new file mode 100644 index 000000000..730e2c4c7 --- /dev/null +++ b/scripts/dosage.spec @@ -0,0 +1,31 @@ +# -*- mode: python -*- + +block_cipher = None + + +a = Analysis(['../dosage'], + pathex=['.'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=['.'], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher) + +a.binaries = [x for x in a.binaries if not x[1].lower().startswith(r'c:\windows')] + +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + name='dosage', + debug=False, + strip=False, + upx=False, + console=True)