Eigene .play-Dateiendung fuer Windows-Patchdateien + manuelle Installation per Doppelklick
Windows-Patch-Pakete heissen jetzt Playtube-vX.Y.Z-win64-patch.play statt .zip (technisch weiterhin ein ganz normales ZIP-Archiv - Windows/Python schauen beim Entpacken auf die Magic Bytes, nicht auf die Endung). Playtube registriert .play beim ersten Start als Windows-Dateizuordnung (HKCU, keine Admin-Rechte noetig), sodass eine manuell heruntergeladene Patchdatei per Doppelklick installiert werden kann, ohne dass Playtube selbst etwas herunterladen muss: - shortcuts.py: ensure_play_file_association() registriert ProgID + DefaultIcon + shell/open/command und stoesst SHChangeNotify an, damit die Zuordnung sofort greift. - updater.py: UpdateInstaller akzeptiert jetzt optional local_archive_path statt einer download_url und ueberspringt dann den Download komplett. - main.py: erkennt eine .play-Datei als Kommandozeilenargument (Doppelklick- Start) und uebergibt sie an MainWindow.install_local_patch(). - release.yml: Windows-Patch wird als .zip gepackt und anschliessend zu .play umbenannt; _find_platform_asset() sucht fuer Windows-Patches jetzt nach .play statt .zip. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
+18
-5
@@ -311,20 +311,33 @@ class MainWindow(QMainWindow):
|
||||
if answer == QMessageBox.StandardButton.Yes:
|
||||
self._start_update_install(download_url)
|
||||
|
||||
def _start_update_install(self, download_url: str) -> None:
|
||||
if not download_url:
|
||||
def _start_update_install(self, download_url: str = "", local_path: str | None = None) -> None:
|
||||
if not download_url and not local_path:
|
||||
return
|
||||
self._settings_tab.hide_install_button()
|
||||
self._settings_tab.set_update_status("Lade Update herunter …")
|
||||
self._settings_tab.set_download_progress(0)
|
||||
if local_path:
|
||||
self._settings_tab.set_update_status("Installiere lokale Patch-Datei …")
|
||||
self._settings_tab.set_download_progress(-1)
|
||||
else:
|
||||
self._settings_tab.set_update_status("Lade Update herunter …")
|
||||
self._settings_tab.set_download_progress(0)
|
||||
self._tray.setToolTip(f"{APP_NAME} – Update wird installiert …")
|
||||
self._update_installer = UpdateInstaller(download_url, self)
|
||||
self._update_installer = UpdateInstaller(
|
||||
download_url, local_archive_path=local_path, parent=self
|
||||
)
|
||||
self._update_installer.progress.connect(self._on_install_progress_text)
|
||||
self._update_installer.progress_percent.connect(self._settings_tab.set_download_progress)
|
||||
self._update_installer.finished_ok.connect(self._on_update_finished)
|
||||
self._update_installer.failed.connect(self._on_update_failed)
|
||||
self._update_installer.start()
|
||||
|
||||
def install_local_patch(self, path: str) -> None:
|
||||
"""Wird von main.py aufgerufen, wenn Playtube per Doppelklick auf eine
|
||||
heruntergeladene .play-Patchdatei gestartet wurde (siehe
|
||||
shortcuts.ensure_play_file_association)."""
|
||||
self._tabs.setCurrentWidget(self._settings_tab)
|
||||
self._start_update_install(local_path=path)
|
||||
|
||||
def _on_install_progress_text(self, msg: str) -> None:
|
||||
self._tray.setToolTip(f"{APP_NAME} – {msg}")
|
||||
self._settings_tab.set_update_status(msg)
|
||||
|
||||
Reference in New Issue
Block a user