Fix frozen-build SSL certs, taskbar icon, and rename _internal to psp-preserve
- config: point SSL at certifi bundle when frozen (fixes store/NPS/TMDB SSL errors) - gui: set app name + window icon for the taskbar - spec: contents_directory=psp-preserve; bundle a .desktop file for Wayland launchers
This commit is contained in:
@@ -11,6 +11,19 @@ _BUNDLE_DIR = getattr(sys, "_MEIPASS", None)
|
||||
|
||||
PROJECT_ROOT = Path(_BUNDLE_DIR).resolve() if _BUNDLE_DIR else Path(__file__).resolve().parent.parent
|
||||
|
||||
# Frozen bundles don't ship the system CA store, so Python's urllib would fail
|
||||
# TLS verification against the store server / NoPayStation / TMDB / archive.org.
|
||||
# Point OpenSSL at the certifi bundle (a curl_cffi dependency) when frozen only;
|
||||
# source runs keep using the OS CA store.
|
||||
if IS_FROZEN:
|
||||
try:
|
||||
import certifi
|
||||
_CA_BUNDLE = certifi.where()
|
||||
os.environ.setdefault("SSL_CERT_FILE", _CA_BUNDLE)
|
||||
os.environ.setdefault("REQUESTS_CA_BUNDLE", _CA_BUNDLE)
|
||||
except Exception: # noqa: BLE001
|
||||
pass
|
||||
|
||||
|
||||
def resource_path(*parts):
|
||||
"""Absolute path to a read-only bundled resource (works when frozen)."""
|
||||
|
||||
@@ -5679,10 +5679,13 @@ def main():
|
||||
log.info("starting psp-preserve (db: %s)", config.DB_PATH)
|
||||
app = QApplication(sys.argv)
|
||||
style.apply_theme(app)
|
||||
app.setApplicationName("PSP Preservation Tool")
|
||||
app.setDesktopFileName("psp-preserve")
|
||||
icon_path = config.PROJECT_ROOT / "img" / "app-icon.png"
|
||||
if icon_path.is_file():
|
||||
app.setWindowIcon(QIcon(str(icon_path)))
|
||||
window = MainWindow()
|
||||
window.setWindowIcon(app.windowIcon())
|
||||
window.show()
|
||||
log.info("main window ready")
|
||||
threading.Thread(target=_start_bundle_check, args=(window,), daemon=True).start()
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=PSP Preservation Tool
|
||||
Comment=Preserve and manage your PSP library
|
||||
Exec=psp-preserve
|
||||
Icon=psp-preserve
|
||||
Terminal=false
|
||||
Categories=Utility;AudioVideo;
|
||||
StartupWMClass=psp-preserve
|
||||
@@ -24,6 +24,7 @@ datas = [
|
||||
("data/covers/UMD_GAME_COVER_TEMPLATE.png", "data/covers"),
|
||||
("img/app-icon.png", "img"),
|
||||
("img/chevron.png", "img"),
|
||||
("packaging/psp-preserve.desktop", "."),
|
||||
]
|
||||
|
||||
a = Analysis(
|
||||
@@ -53,6 +54,7 @@ exe = EXE(
|
||||
upx=False,
|
||||
console=False,
|
||||
disable_windowed_traceback=False,
|
||||
contents_directory="psp-preserve",
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
|
||||
Reference in New Issue
Block a user