Compare commits

..

2 Commits

Author SHA1 Message Date
08231fde30 Finish fixing icon 2024-07-21 15:28:23 -07:00
bb4f87e5ed Partially fix icon in Windows builds 2024-07-21 14:46:36 -07:00
5 changed files with 26 additions and 9 deletions

View File

@ -24,11 +24,13 @@ connect to Navpoint Desktop.
## Licensing ## Licensing
Navpoint Desktop is released under the [GNU General Public License Navpoint Desktop is released under the [GNU General Public License
v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), except the file v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), except the files
`navpoint/get_ip.py`, which is released under [Creative Commons `navpoint/get_ip.py` and `navpoint.fix_path`, which are released under
Attribution-ShareAlike 4.0 [Creative Commons Attribution-ShareAlike 4.0
International](https://creativecommons.org/licenses/by-sa/4.0/) due to use of International](https://creativecommons.org/licenses/by-sa/4.0/) due to use of
[code published on Stack Overflow](https://stackoverflow.com/a/28950776). code published on Stack Overflow
([`get_ip.py`](https://stackoverflow.com/a/28950776) and
[`fix_path.py`](https://stackoverflow.com/a/53605128)).
Navpoint Mobile is released under the [GNU General Public License Navpoint Mobile is released under the [GNU General Public License
v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html). v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).

View File

@ -1,3 +1 @@
pyinstaller -w -F --hidden-import tornado.web main.py pyinstaller -i=icon.ico --windowed --onefile --hidden-import tornado.web --add-data icon.ico:files --name=navpoint-windows-%PROCESSOR_ARCHITECTURE%.exe main.py
move dist/main.exe dist/navpoint-windows-%PROCESSOR_ARCHITECTURE%.exe

BIN
icon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 30 KiB

16
navpoint/fix_path.py Normal file
View File

@ -0,0 +1,16 @@
# Copyright 2018 Stack Overflow user "Kamal"
# Copyright 2024 Samuel Sloniker
#
# https://stackoverflow.com/a/53605128
#
# Used, modified, and released under CC BY-SA 4.0:
# https://creativecommons.org/licenses/by-sa/4.0/
import sys
import os.path
def fix_path(path):
if getattr(sys, 'frozen', False):
return os.path.join(sys._MEIPASS, "files", path)
else:
return path

View File

@ -1,5 +1,6 @@
import tkinter as tk import tkinter as tk
import pyqrcode import pyqrcode
import navpoint.fix_path
def run(link): def run(link):
@ -19,8 +20,8 @@ def run(link):
label.config(image=image) label.config(image=image)
try: try:
window.iconbitmap("icon.ico") window.iconbitmap(navpoint.fix_path.fix_path("icon.ico"))
except tk.TclError: except ImportError:#tk.TclError:
pass pass