-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyinstaller.spec
68 lines (57 loc) · 2.01 KB
/
pyinstaller.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- mode: python -*-
# -*- coding: utf-8 -*-
"""
This is a PyInstaller spec file.
"""
import os
from PyInstaller.building.api import PYZ, EXE, COLLECT
from PyInstaller.building.build_main import Analysis
from PyInstaller.utils.hooks import is_module_satisfies
from PyInstaller.archive.pyz_crypto import PyiBlockCipher
# Constants
DEBUG = os.environ.get("CEFPYTHON_PYINSTALLER_DEBUG", False)
PYCRYPTO_MIN_VERSION = "2.6.1"
# Set this secret cipher to some secret value. It will be used
# to encrypt archive package containing your app's bytecode
# compiled Python modules, to make it harder to extract these
# files and decompile them. If using secret cipher then you
# must install pycrypto package by typing: "pip install pycrypto".
# Note that this will only encrypt archive package containing
# imported modules, it won't encrypt the main script file
# (wxpython.py). The names of all imported Python modules can be
# still accessed, only their contents are encrypted.
SECRET_CIPHER = "This-is-a-secret-phrase" # Only first 16 chars are used
# ----------------------------------------------------------------------------
# Main
# ----------------------------------------------------------------------------
if SECRET_CIPHER:
cipher_obj = None
a = Analysis(
["wxpython.py"],
hookspath=["."], # To find "hook-cefpython3.py"
cipher=cipher_obj,
win_private_assemblies=True,
win_no_prefer_redirects=True,
)
if not os.environ.get("PYINSTALLER_CEFPYTHON3_HOOK_SUCCEEDED", None):
raise SystemExit("Error: Pyinstaller hook-cefpython3.py script was "
"not executed or it failed")
pyz = PYZ(a.pure,
a.zipped_data,
cipher=cipher_obj)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name="cefapp",
debug=DEBUG,
strip=False,
upx=False,
console=DEBUG,
icon="wxpython.ico")
COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name="cefapp")