mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Add Windows changes
This commit is contained in:
parent
11d0c6c88f
commit
269cf5b431
4 changed files with 80 additions and 54 deletions
10
BUILD.md
10
BUILD.md
|
@ -59,7 +59,7 @@ poetry install
|
|||
Run from source tree:
|
||||
|
||||
```
|
||||
poetry run ./dev_scripts/dangerzone
|
||||
poetry run dangerzone
|
||||
```
|
||||
|
||||
To create an app bundle and DMG for distribution, use the `build_app.py` script
|
||||
|
@ -87,9 +87,7 @@ The output is in the `dist` folder.
|
|||
|
||||
These instructions include adding folders to the path in Windows. To do this, go to Start and type "advanced system settings", and open "View advanced system settings" in the Control Panel. Click Environment Variables. Under "System variables" double-click on Path. From there you can add and remove folders that are available in the PATH.
|
||||
|
||||
Download Python 3.7.6, 32-bit (x86) from https://www.python.org/downloads/release/python-376/. I downloaded python-3.7.6.exe. When installing it, make sure to check the "Add Python 3.7 to PATH" checkbox on the first page of the installer.
|
||||
|
||||
Install the Qt 5.14.1 from https://www.qt.io/offline-installers. I downloaded qt-opensource-windows-x86-5.14.1.exe. In the installer, unfortunately you have login to an account. Then all you need `Qt` > `Qt 5.14.1` > `MSVC 2017 32-bit`.
|
||||
Download Python 3.9.0, 32-bit (x86) from https://www.python.org/downloads/release/python-390/. I downloaded python-3.9.0.exe. When installing it, make sure to check the "Add Python 3.9 to PATH" checkbox on the first page of the installer.
|
||||
|
||||
Install [poetry](https://python-poetry.org/). Open PowerShell, and run:
|
||||
|
||||
|
@ -97,7 +95,7 @@ Install [poetry](https://python-poetry.org/). Open PowerShell, and run:
|
|||
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
|
||||
```
|
||||
|
||||
And add `%USERPROFILE%\.poetry\bin` to your path. Then open a command prompt and cd to the `dangerzone` folder, and install the poetry dependencies:
|
||||
Change to the `dangerzone` folder, and install the poetry dependencies:
|
||||
|
||||
```
|
||||
poetry install
|
||||
|
@ -106,7 +104,7 @@ poetry install
|
|||
After that you can launch dangerzone during development with:
|
||||
|
||||
```
|
||||
poetry run python dev_scripts\dangerzone
|
||||
poetry run dangerzone
|
||||
```
|
||||
|
||||
### If you want to build a .exe
|
||||
|
|
|
@ -61,7 +61,7 @@ class DockerInstaller(QtWidgets.QDialog):
|
|||
|
||||
self.setWindowTitle("dangerzone")
|
||||
self.setWindowIcon(self.global_common.get_window_icon())
|
||||
self.setMinimumHeight(170)
|
||||
# self.setMinimumHeight(170)
|
||||
|
||||
label = QtWidgets.QLabel()
|
||||
if platform.system() == "Darwin":
|
||||
|
@ -90,9 +90,13 @@ class DockerInstaller(QtWidgets.QDialog):
|
|||
self.cancel_button = QtWidgets.QPushButton("Cancel")
|
||||
self.cancel_button.clicked.connect(self.cancel_clicked)
|
||||
|
||||
self.ok_button = QtWidgets.QPushButton("OK")
|
||||
self.ok_button.clicked.connect(self.ok_clicked)
|
||||
|
||||
buttons_layout = QtWidgets.QHBoxLayout()
|
||||
buttons_layout.addStretch()
|
||||
buttons_layout.addWidget(self.open_finder_button)
|
||||
buttons_layout.addWidget(self.ok_button)
|
||||
buttons_layout.addWidget(self.cancel_button)
|
||||
buttons_layout.addStretch()
|
||||
|
||||
|
@ -163,6 +167,16 @@ class DockerInstaller(QtWidgets.QDialog):
|
|||
except:
|
||||
pass
|
||||
|
||||
def ok_clicked(self):
|
||||
self.accept()
|
||||
|
||||
if self.download_t:
|
||||
self.download_t.quit()
|
||||
try:
|
||||
os.remove(self.installer_filename)
|
||||
except:
|
||||
pass
|
||||
|
||||
def open_finder_clicked(self):
|
||||
if platform.system() == "Darwin":
|
||||
subprocess.call(["open", "-R", self.open_finder_path])
|
||||
|
@ -179,12 +193,22 @@ class DockerInstaller(QtWidgets.QDialog):
|
|||
docker_app_path = "C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe"
|
||||
|
||||
if not os.path.exists(docker_app_path):
|
||||
if platform.system() == "Windows":
|
||||
self.task_label.setText(
|
||||
"<a href='https://docs.docker.com/docker-for-windows/install/'>Download Docker</a>, install it, and then run Dangerzone again."
|
||||
)
|
||||
self.task_label.setTextFormat(QtCore.Qt.RichText)
|
||||
self.progress.hide()
|
||||
self.cancel_button.hide()
|
||||
else:
|
||||
self.ok_button.hide()
|
||||
self.download()
|
||||
else:
|
||||
self.task_label.setText(
|
||||
"Docker is installed, but you must launch it first. Open Docker, make sure it's running, and then open Dangerzone again."
|
||||
)
|
||||
self.progress.hide()
|
||||
self.ok_button.hide()
|
||||
self.cancel_button.hide()
|
||||
|
||||
self.open_finder_path = docker_app_path
|
||||
|
|
72
poetry.lock
generated
72
poetry.lock
generated
|
@ -38,14 +38,6 @@ category = "main"
|
|||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
|
||||
[[package]]
|
||||
name = "dis3"
|
||||
version = "0.1.3"
|
||||
description = "Python 2.7 backport of the \"dis\" module from Python 3.5+"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "2.10"
|
||||
|
@ -67,15 +59,28 @@ altgraph = ">=0.15"
|
|||
|
||||
[[package]]
|
||||
name = "pyinstaller"
|
||||
version = "3.6"
|
||||
version = "4.0"
|
||||
description = "PyInstaller bundles a Python application and all its dependencies into a single package."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
altgraph = "*"
|
||||
dis3 = "*"
|
||||
macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""}
|
||||
pyinstaller-hooks-contrib = ">=2020.6"
|
||||
|
||||
[package.extras]
|
||||
encryption = ["tinyaes (>=1.0.0)"]
|
||||
hook_testing = ["pytest (>=2.7.3)", "execnet (>=1.5.0)", "psutil"]
|
||||
|
||||
[[package]]
|
||||
name = "pyinstaller-hooks-contrib"
|
||||
version = "2020.9"
|
||||
description = "Community maintained hooks for PyInstaller"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "pyobjc-core"
|
||||
|
@ -145,7 +150,7 @@ shiboken2 = "5.15.1"
|
|||
|
||||
[[package]]
|
||||
name = "pywin32"
|
||||
version = "227"
|
||||
version = "228"
|
||||
description = "Python for Window Extensions"
|
||||
category = "main"
|
||||
optional = false
|
||||
|
@ -153,7 +158,7 @@ python-versions = "*"
|
|||
|
||||
[[package]]
|
||||
name = "pyxdg"
|
||||
version = "0.26"
|
||||
version = "0.27"
|
||||
description = "PyXDG contains implementations of freedesktop.org standards in python."
|
||||
category = "main"
|
||||
optional = false
|
||||
|
@ -227,7 +232,7 @@ tests = ["pytest"]
|
|||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = ">=3.7,<3.10"
|
||||
content-hash = "21cab7363f119ab648f232ee2ae19b64e8113aede19e67da58c65818e71e90c0"
|
||||
content-hash = "dd8ed673b0bfda46b5c4ff39858b7a33dcdeb16fa0fd872c169c0176695c9a12"
|
||||
|
||||
[metadata.files]
|
||||
altgraph = [
|
||||
|
@ -250,11 +255,6 @@ click = [
|
|||
{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},
|
||||
{file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"},
|
||||
]
|
||||
dis3 = [
|
||||
{file = "dis3-0.1.3-py2-none-any.whl", hash = "sha256:61f7720dd0d8749d23fda3d7227ce74d73da11c2fade993a67ab2f9852451b14"},
|
||||
{file = "dis3-0.1.3-py3-none-any.whl", hash = "sha256:30b6412d33d738663e8ded781b138f4b01116437f0872aa56aa3adba6aeff218"},
|
||||
{file = "dis3-0.1.3.tar.gz", hash = "sha256:9259b881fc1df02ed12ac25f82d4a85b44241854330b1a651e40e0c675cb2d1e"},
|
||||
]
|
||||
idna = [
|
||||
{file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"},
|
||||
{file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"},
|
||||
|
@ -264,7 +264,11 @@ macholib = [
|
|||
{file = "macholib-1.14.tar.gz", hash = "sha256:0c436bc847e7b1d9bda0560351bf76d7caf930fb585a828d13608839ef42c432"},
|
||||
]
|
||||
pyinstaller = [
|
||||
{file = "PyInstaller-3.6.tar.gz", hash = "sha256:3730fa80d088f8bb7084d32480eb87cbb4ddb64123363763cf8f2a1378c1c4b7"},
|
||||
{file = "pyinstaller-4.0.tar.gz", hash = "sha256:970beb07115761d5e4ec317c1351b712fd90ae7f23994db914c633281f99bab0"},
|
||||
]
|
||||
pyinstaller-hooks-contrib = [
|
||||
{file = "pyinstaller-hooks-contrib-2020.9.tar.gz", hash = "sha256:a5fd45a920012802e3f2089e1d3501ef2f49265dfea8fc46c3310f18e3326c91"},
|
||||
{file = "pyinstaller_hooks_contrib-2020.9-py2.py3-none-any.whl", hash = "sha256:c382f3ac1a42b45cfecd581475c36db77da90e479b2f5bcb6d840d21fa545114"},
|
||||
]
|
||||
pyobjc-core = [
|
||||
{file = "pyobjc-core-6.2.2.tar.gz", hash = "sha256:38e7b15a042439dadd18b28b78229e52fb882460fc16ddbae342b9972d5a827c"},
|
||||
|
@ -301,22 +305,22 @@ pyside2 = [
|
|||
{file = "PySide2-5.15.1-5.15.1-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl", hash = "sha256:3c9a24557edf25b60fded6ed99a9b5e4b287be1cc3857e76e18dd930e54240e3"},
|
||||
]
|
||||
pywin32 = [
|
||||
{file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"},
|
||||
{file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"},
|
||||
{file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"},
|
||||
{file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"},
|
||||
{file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"},
|
||||
{file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"},
|
||||
{file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"},
|
||||
{file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"},
|
||||
{file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"},
|
||||
{file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"},
|
||||
{file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"},
|
||||
{file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"},
|
||||
{file = "pywin32-228-cp27-cp27m-win32.whl", hash = "sha256:37dc9935f6a383cc744315ae0c2882ba1768d9b06700a70f35dc1ce73cd4ba9c"},
|
||||
{file = "pywin32-228-cp27-cp27m-win_amd64.whl", hash = "sha256:11cb6610efc2f078c9e6d8f5d0f957620c333f4b23466931a247fb945ed35e89"},
|
||||
{file = "pywin32-228-cp35-cp35m-win32.whl", hash = "sha256:1f45db18af5d36195447b2cffacd182fe2d296849ba0aecdab24d3852fbf3f80"},
|
||||
{file = "pywin32-228-cp35-cp35m-win_amd64.whl", hash = "sha256:6e38c44097a834a4707c1b63efa9c2435f5a42afabff634a17f563bc478dfcc8"},
|
||||
{file = "pywin32-228-cp36-cp36m-win32.whl", hash = "sha256:ec16d44b49b5f34e99eb97cf270806fdc560dff6f84d281eb2fcb89a014a56a9"},
|
||||
{file = "pywin32-228-cp36-cp36m-win_amd64.whl", hash = "sha256:a60d795c6590a5b6baeacd16c583d91cce8038f959bd80c53bd9a68f40130f2d"},
|
||||
{file = "pywin32-228-cp37-cp37m-win32.whl", hash = "sha256:af40887b6fc200eafe4d7742c48417529a8702dcc1a60bf89eee152d1d11209f"},
|
||||
{file = "pywin32-228-cp37-cp37m-win_amd64.whl", hash = "sha256:00eaf43dbd05ba6a9b0080c77e161e0b7a601f9a3f660727a952e40140537de7"},
|
||||
{file = "pywin32-228-cp38-cp38-win32.whl", hash = "sha256:fa6ba028909cfc64ce9e24bcf22f588b14871980d9787f1e2002c99af8f1850c"},
|
||||
{file = "pywin32-228-cp38-cp38-win_amd64.whl", hash = "sha256:9b3466083f8271e1a5eb0329f4e0d61925d46b40b195a33413e0905dccb285e8"},
|
||||
{file = "pywin32-228-cp39-cp39-win32.whl", hash = "sha256:ed74b72d8059a6606f64842e7917aeee99159ebd6b8d6261c518d002837be298"},
|
||||
{file = "pywin32-228-cp39-cp39-win_amd64.whl", hash = "sha256:8319bafdcd90b7202c50d6014efdfe4fde9311b3ff15fd6f893a45c0868de203"},
|
||||
]
|
||||
pyxdg = [
|
||||
{file = "pyxdg-0.26-py2.py3-none-any.whl", hash = "sha256:1948ff8e2db02156c0cccd2529b43c0cff56ebaa71f5f021bbd755bc1419190e"},
|
||||
{file = "pyxdg-0.26.tar.gz", hash = "sha256:fe2928d3f532ed32b39c32a482b54136fe766d19936afc96c8f00645f9da1a06"},
|
||||
{file = "pyxdg-0.27-py2.py3-none-any.whl", hash = "sha256:2d6701ab7c74bbab8caa6a95e0a0a129b1643cf6c298bf7c569adec06d0709a0"},
|
||||
{file = "pyxdg-0.27.tar.gz", hash = "sha256:80bd93aae5ed82435f20462ea0208fb198d8eec262e831ee06ce9ddb6b91c5a5"},
|
||||
]
|
||||
requests = [
|
||||
{file = "requests-2.24.0-py2.py3-none-any.whl", hash = "sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898"},
|
||||
|
|
|
@ -7,21 +7,21 @@ license = "MIT"
|
|||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.7,<3.10"
|
||||
click = "^7.0"
|
||||
appdirs = "^1.4.3"
|
||||
requests = "^2.22.0"
|
||||
macholib = "^1.14"
|
||||
termcolor = "^1.1.0"
|
||||
click = "*"
|
||||
appdirs = "*"
|
||||
requests = "*"
|
||||
macholib = "*"
|
||||
termcolor = "*"
|
||||
PySide2 = "^5.15.1"
|
||||
pywin32 = {version = "^227", platform = "windows"}
|
||||
wmi = {version = "^1.4.9", platform = "windows"}
|
||||
pyxdg = {version = "^0.26", platform = "linux"}
|
||||
pyobjc-core = {version = "^6.1", platform = "darwin"}
|
||||
pyobjc-framework-launchservices = {version = "^6.1", platform = "darwin"}
|
||||
pywin32 = {version = "*", platform = "win32"}
|
||||
wmi = {version = "*", platform = "win32"}
|
||||
pyxdg = {version = "*", platform = "linux"}
|
||||
pyobjc-core = {version = "*", platform = "darwin"}
|
||||
pyobjc-framework-launchservices = {version = "*", platform = "darwin"}
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
pyinstaller = {version = "^3.6", platform = "darwin"}
|
||||
setuptools = {version = "^45.2.0", platform = "windows"}
|
||||
pyinstaller = {version = "*", platform = "darwin"}
|
||||
setuptools = {version = "*", platform = "win32"}
|
||||
|
||||
[tool.poetry.scripts]
|
||||
dangerzone = 'dangerzone:main'
|
||||
|
|
Loading…
Reference in a new issue