fix: make updater show actual error messages in popup

This commit is contained in:
joel
2026-07-30 09:13:22 +02:00
parent fca6637f50
commit 04ff4dc163
2 changed files with 14 additions and 10 deletions
+6 -4
View File
@@ -904,16 +904,18 @@ class App(ctk.CTk):
self.after(0, lambda: self._set_status(msg, T["warn"]))
self.after(0, lambda: self.total_bar.set(pct / 100))
def _go():
ok = download_and_install_update(rel, progress_callback=_p)
self.after(0, lambda: self._upd_fin(ok))
ok, msg = download_and_install_update(rel, progress_callback=_p)
self.after(0, lambda: self._upd_fin(ok, msg))
import threading
threading.Thread(target=_go, daemon=True).start()
def _upd_fin(self, ok):
def _upd_fin(self, ok, msg=""):
self.update_btn.configure(state="normal", text=" Update prüfen")
if ok:
messagebox.showinfo("Update", "Bitte neu starten.")
messagebox.showinfo("Update", "Update erfolgreich installiert! Bitte das Programm neu starten.")
else:
self._set_status("Update fehlgeschlagen", T["error"])
messagebox.showerror("Update fehlgeschlagen", msg)
self.after(30, self._activate)
# =================================================================