mirror of
https://github.com/onionshare/onionshare.git
synced 2025-09-20 12:34:40 -04:00
Switched from py2app to PyInstaller for Windows. Renamed version to version.txt, to avoid Windows namespace collision with version.dll.
This commit is contained in:
parent
229603eb7d
commit
ef5665b050
15 changed files with 73 additions and 187 deletions
|
@ -3,7 +3,7 @@
|
|||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
|
||||
cd $DIR
|
||||
|
||||
VERSION=`cat version`
|
||||
VERSION=`cat version.txt`
|
||||
|
||||
# clean up from last build
|
||||
rm -r deb_dist >/dev/null 2>&1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
REM use py2exe to builder a folder with onionshare.exe
|
||||
python setup.py py2exe
|
||||
REM use PyInstaller to builder a folder with onionshare.exe
|
||||
pyinstaller install/pyinstaller.spec
|
||||
|
||||
REM sign onionshare.exe
|
||||
signtool.exe sign /v /d "OnionShare" /a /tr http://timestamp.globalsign.com/scripts/timstamp.dll /fd sha256 dist\onionshare.exe
|
||||
|
|
|
@ -9,7 +9,7 @@ rm -rf $ROOT/dist &>/dev/null 2>&1
|
|||
|
||||
# build the .app
|
||||
echo Building OnionShare.app
|
||||
pyinstaller install/pyinstaller-osx.spec
|
||||
pyinstaller install/pyinstaller.spec
|
||||
|
||||
if [ "$1" = "--sign" ]; then
|
||||
SIGNING_IDENTITY_APP="3rd Party Mac Developer Application: Micah Lee"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
|
||||
cd $DIR
|
||||
|
||||
VERSION=`cat version`
|
||||
VERSION=`cat version.txt`
|
||||
|
||||
# clean up from last build
|
||||
rm -r build dist >/dev/null 2>&1
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
OnionShare | https://onionshare.org/
|
||||
|
||||
Copyright (C) 2016 Micah Lee <micah@micahflee.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import zipimport, os, inspect
|
||||
|
||||
original_cwd = os.getcwd()
|
||||
new_cwd = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
||||
os.chdir(new_cwd)
|
||||
|
||||
zi = zipimport.zipimporter('lib/python2.7/site-packages.zip')
|
||||
onionshare = zi.load_module('onionshare')
|
||||
|
||||
onionshare.main(original_cwd)
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
OnionShare | https://onionshare.org/
|
||||
|
||||
Copyright (C) 2016 Micah Lee <micah@micahflee.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import onionshare_gui
|
||||
onionshare_gui.main()
|
|
@ -1,16 +1,19 @@
|
|||
# -*- mode: python -*-
|
||||
|
||||
import platform
|
||||
system = platform.system()
|
||||
|
||||
block_cipher = None
|
||||
|
||||
a = Analysis(
|
||||
['osx_scripts/onionshare-gui'],
|
||||
['linux_scripts/onionshare-gui'],
|
||||
pathex=['.'],
|
||||
binaries=None,
|
||||
datas=[
|
||||
('../images/*', 'images'),
|
||||
('../locale/*', 'locale'),
|
||||
('../onionshare/*.html', 'html'),
|
||||
('../version', '.')
|
||||
('../images/*', 'images'),
|
||||
('../locale/*', 'locale'),
|
||||
('../onionshare/*.html', 'html'),
|
||||
('../version.txt', '.')
|
||||
],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
|
@ -28,11 +31,11 @@ exe = EXE(
|
|||
pyz,
|
||||
a.scripts,
|
||||
exclude_binaries=True,
|
||||
name='onionshare-gui',
|
||||
name='onionshare',
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=False)
|
||||
console=True)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
|
@ -41,13 +44,15 @@ coll = COLLECT(
|
|||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='onionshare-gui')
|
||||
name='onionshare')
|
||||
|
||||
app = BUNDLE(
|
||||
coll,
|
||||
name='OnionShare.app',
|
||||
icon='install/onionshare.icns',
|
||||
bundle_identifier='com.micahflee.onionshare',
|
||||
info_plist={
|
||||
'NSHighResolutionCapable': 'True'
|
||||
})
|
||||
if system == 'Darwin':
|
||||
app = BUNDLE(
|
||||
coll,
|
||||
name='OnionShare.app',
|
||||
icon='install/onionshare.icns',
|
||||
bundle_identifier='com.micahflee.onionshare',
|
||||
info_plist={
|
||||
'NSHighResolutionCapable': 'True'
|
||||
}
|
||||
)
|
|
@ -1,37 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
OnionShare | https://onionshare.org/
|
||||
|
||||
Copyright (C) 2016 Micah Lee <micah@micahflee.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import division
|
||||
import os, subprocess, time, hashlib, platform, json, locale, socket
|
||||
import argparse, queue, inspect, base64, random, functools, logging, ctypes
|
||||
import hmac, shutil
|
||||
import stem, stem.control, flask
|
||||
from PyQt5 import QtCore, QtWidgets, QtGui
|
||||
|
||||
import onionshare, onionshare_gui
|
||||
|
||||
# Disable py2exe logging in Windows. Comment these if you need logs. See:
|
||||
# http://www.py2exe.org/index.cgi/StderrLog
|
||||
# http://stackoverflow.com/questions/20549843/py2exe-generate-log-file
|
||||
import sys
|
||||
f = open(os.devnull, 'w')
|
||||
sys.stdout = f
|
||||
sys.stderr = f
|
||||
|
||||
onionshare_gui.main()
|
Loading…
Add table
Add a link
Reference in a new issue