summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2020-10-11 15:57:55 -0700
committerMicah Lee <micah@micahflee.com>2020-10-11 15:57:55 -0700
commit14ac43445d74430c10824e568878532ce16d5924 (patch)
tree40388dcd635803b28366eacb8f0e3d2e3caa3e1d
parent80e4ecce403b45dcacf04b074f22478f48ecd1e6 (diff)
downloadonionshare-14ac43445d74430c10824e568878532ce16d5924.tar.gz
onionshare-14ac43445d74430c10824e568878532ce16d5924.zip
Add PyInstaller and Windows SDK paths to the PyInstaller paths
-rw-r--r--install/pyinstaller.spec121
1 files changed, 85 insertions, 36 deletions
diff --git a/install/pyinstaller.spec b/install/pyinstaller.spec
index a1774615..24c0ed07 100644
--- a/install/pyinstaller.spec
+++ b/install/pyinstaller.spec
@@ -1,67 +1,116 @@
# -*- mode: python -*-
+import os
import platform
+from distutils.sysconfig import get_python_lib
+
p = platform.system()
-version = open('share/version.txt').read().strip()
+version = open("share/version.txt").read().strip()
+
+paths = ["."]
+if p == "Windows":
+ paths.append(os.path.join(get_python_lib(), "PyQt5", "Qt", "bin"))
+ paths.append(
+ os.path.join(
+ os.path.abspath(os.sep),
+ "Program Files (x86)",
+ "Windows Kits",
+ "10",
+ "bin",
+ "x86",
+ )
+ )
+ paths.append(
+ os.path.join(
+ os.path.abspath(os.sep),
+ "Program Files (x86)",
+ "Windows Kits",
+ "10",
+ "bin",
+ "x64",
+ )
+ )
+ paths.append(
+ os.path.join(
+ os.path.abspath(os.sep),
+ "Program Files (x86)",
+ "Windows Kits",
+ "10",
+ "Redist",
+ "ucrt",
+ "DLLs",
+ "x86",
+ )
+ )
+ paths.append(
+ os.path.join(
+ os.path.abspath(os.sep),
+ "Program Files (x86)",
+ "Windows Kits",
+ "10",
+ "Redist",
+ "ucrt",
+ "DLLs",
+ "x64",
+ )
+ )
a = Analysis(
- ['scripts/onionshare-pyinstaller'],
- pathex=['.'],
+ ["scripts/onionshare-pyinstaller"],
+ pathex=paths,
binaries=None,
datas=[
- ('../share/version.txt', 'share'),
- ('../share/wordlist.txt', 'share'),
- ('../share/torrc_template', 'share'),
- ('../share/torrc_template-obfs4', 'share'),
- ('../share/torrc_template-meek_lite_azure', 'share'),
- ('../share/images/*', 'share/images'),
- ('../share/locale/*', 'share/locale'),
- ('../share/static/*', 'share/static'),
- ('../share/templates/*', 'share/templates'),
- ('../share/static/css/*', 'share/static/css'),
- ('../share/static/img/*', 'share/static/img'),
- ('../share/static/js/*', 'share/static/js'),
- ('../install/licenses/*', 'licenses')
+ ("../share/version.txt", "share"),
+ ("../share/wordlist.txt", "share"),
+ ("../share/torrc_template", "share"),
+ ("../share/torrc_template-obfs4", "share"),
+ ("../share/torrc_template-meek_lite_azure", "share"),
+ ("../share/images/*", "share/images"),
+ ("../share/locale/*", "share/locale"),
+ ("../share/static/*", "share/static"),
+ ("../share/templates/*", "share/templates"),
+ ("../share/static/css/*", "share/static/css"),
+ ("../share/static/img/*", "share/static/img"),
+ ("../share/static/js/*", "share/static/js"),
+ ("../install/licenses/*", "licenses"),
],
hiddenimports=["engineio.async_drivers.threading"],
hookspath=[],
runtime_hooks=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
- cipher=None)
+ cipher=None,
+)
+
+pyz = PYZ(a.pure, a.zipped_data, cipher=None)
-pyz = PYZ(
- a.pure, a.zipped_data,
- cipher=None)
+# Show console in dev releases, don't show console in production releases
+console = "dev" in version
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
- name='onionshare-gui',
+ name="onionshare-gui",
debug=False,
strip=False,
upx=True,
- console=False)
+ console=console,
+)
coll = COLLECT(
- exe,
- a.binaries,
- a.zipfiles,
- a.datas,
- strip=False,
- upx=True,
- name='onionshare')
+ exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, name="onionshare"
+)
-if p == 'Darwin':
+if p == "Darwin":
app = BUNDLE(
coll,
- name='OnionShare.app',
- icon='onionshare.icns',
- bundle_identifier='com.micahflee.onionshare',
+ name="OnionShare.app",
+ icon="onionshare.icns",
+ bundle_identifier="com.micahflee.onionshare",
info_plist={
- 'CFBundleShortVersionString': version,
- 'NSHighResolutionCapable': 'True'
- }
+ "CFBundleShortVersionString": version,
+ "NSHighResolutionCapable": "True",
+ },
)