mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-12 11:22:14 -04:00
Add PyInstaller and Windows SDK paths to the PyInstaller paths
This commit is contained in:
parent
fb51208214
commit
c0422760f2
1 changed files with 85 additions and 36 deletions
|
@ -1,67 +1,116 @@
|
||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
|
|
||||||
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
from distutils.sysconfig import get_python_lib
|
||||||
|
|
||||||
p = platform.system()
|
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(
|
a = Analysis(
|
||||||
['scripts/onionshare-pyinstaller'],
|
["scripts/onionshare-pyinstaller"],
|
||||||
pathex=['.'],
|
pathex=paths,
|
||||||
binaries=None,
|
binaries=None,
|
||||||
datas=[
|
datas=[
|
||||||
('../share/version.txt', 'share'),
|
("../share/version.txt", "share"),
|
||||||
('../share/wordlist.txt', 'share'),
|
("../share/wordlist.txt", "share"),
|
||||||
('../share/torrc_template', 'share'),
|
("../share/torrc_template", "share"),
|
||||||
('../share/torrc_template-obfs4', 'share'),
|
("../share/torrc_template-obfs4", "share"),
|
||||||
('../share/torrc_template-meek_lite_azure', 'share'),
|
("../share/torrc_template-meek_lite_azure", "share"),
|
||||||
('../share/images/*', 'share/images'),
|
("../share/images/*", "share/images"),
|
||||||
('../share/locale/*', 'share/locale'),
|
("../share/locale/*", "share/locale"),
|
||||||
('../share/static/*', 'share/static'),
|
("../share/static/*", "share/static"),
|
||||||
('../share/templates/*', 'share/templates'),
|
("../share/templates/*", "share/templates"),
|
||||||
('../share/static/css/*', 'share/static/css'),
|
("../share/static/css/*", "share/static/css"),
|
||||||
('../share/static/img/*', 'share/static/img'),
|
("../share/static/img/*", "share/static/img"),
|
||||||
('../share/static/js/*', 'share/static/js'),
|
("../share/static/js/*", "share/static/js"),
|
||||||
('../install/licenses/*', 'licenses')
|
("../install/licenses/*", "licenses"),
|
||||||
],
|
],
|
||||||
hiddenimports=["engineio.async_drivers.threading"],
|
hiddenimports=["engineio.async_drivers.threading"],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
win_no_prefer_redirects=False,
|
win_no_prefer_redirects=False,
|
||||||
win_private_assemblies=False,
|
win_private_assemblies=False,
|
||||||
cipher=None)
|
cipher=None,
|
||||||
|
)
|
||||||
|
|
||||||
pyz = PYZ(
|
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
|
||||||
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(
|
exe = EXE(
|
||||||
pyz,
|
pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
exclude_binaries=True,
|
exclude_binaries=True,
|
||||||
name='onionshare-gui',
|
name="onionshare-gui",
|
||||||
debug=False,
|
debug=False,
|
||||||
strip=False,
|
strip=False,
|
||||||
upx=True,
|
upx=True,
|
||||||
console=False)
|
console=console,
|
||||||
|
)
|
||||||
|
|
||||||
coll = COLLECT(
|
coll = COLLECT(
|
||||||
exe,
|
exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, name="onionshare"
|
||||||
a.binaries,
|
)
|
||||||
a.zipfiles,
|
|
||||||
a.datas,
|
|
||||||
strip=False,
|
|
||||||
upx=True,
|
|
||||||
name='onionshare')
|
|
||||||
|
|
||||||
if p == 'Darwin':
|
if p == "Darwin":
|
||||||
app = BUNDLE(
|
app = BUNDLE(
|
||||||
coll,
|
coll,
|
||||||
name='OnionShare.app',
|
name="OnionShare.app",
|
||||||
icon='onionshare.icns',
|
icon="onionshare.icns",
|
||||||
bundle_identifier='com.micahflee.onionshare',
|
bundle_identifier="com.micahflee.onionshare",
|
||||||
info_plist={
|
info_plist={
|
||||||
'CFBundleShortVersionString': version,
|
"CFBundleShortVersionString": version,
|
||||||
'NSHighResolutionCapable': 'True'
|
"NSHighResolutionCapable": "True",
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue