diff --git a/app/config.py b/app/config.py index 109ae61..22812ca 100644 --- a/app/config.py +++ b/app/config.py @@ -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).""" diff --git a/app/gui.py b/app/gui.py index 5ea3bff..efd1a96 100644 --- a/app/gui.py +++ b/app/gui.py @@ -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() diff --git a/packaging/psp-preserve.desktop b/packaging/psp-preserve.desktop new file mode 100644 index 0000000..7d02c9d --- /dev/null +++ b/packaging/psp-preserve.desktop @@ -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 diff --git a/psp-preserve.spec b/psp-preserve.spec index 9c8292d..df9c077 100644 --- a/psp-preserve.spec +++ b/psp-preserve.spec @@ -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(