pruef_installation hinterlaesst den Zustand, den er vorfindet
War das Programm vorher installiert, ist es danach wieder installiert. Beim ersten Lauf war es das NICHT - danach stand ein deinstalliertes Programm da, und der naechste Schritt (den Updater starten lassen) lief ins Leere. Ein Pruefstand, der aufraeumt, muss auch sich selbst aufraeumen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4t48uxDok5rJXhC9bX1Ax
This commit is contained in:
parent
8cdd106a08
commit
dcc556217b
1 changed files with 14 additions and 0 deletions
|
|
@ -36,6 +36,12 @@ programme gehoeren zu der firma"*.
|
|||
⚠ DIESER PRUEFSTAND INSTALLIERT WIRKLICH. Er laeuft deshalb nur, wenn das
|
||||
Setup gebaut ist, und er fasst NUR die Programmordner an - vorhandene Daten
|
||||
werden vorher gesichert und danach zurueckgelegt.
|
||||
|
||||
Und er hinterlaesst den Zustand, den er vorgefunden hat: war das Programm
|
||||
vorher installiert, ist es danach wieder installiert. Beim ersten Lauf war es
|
||||
das NICHT - danach stand ein deinstalliertes Programm da, und der naechste
|
||||
Schritt lief ins Leere. Ein Pruefstand, der aufraeumt, muss auch sich selbst
|
||||
aufraeumen.
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
|
|
@ -116,6 +122,7 @@ if os.path.isdir(RAVOKK):
|
|||
print(f" ({len(gesichert)} vorhandene Datei(en) gesichert)")
|
||||
|
||||
beenden()
|
||||
war_installiert = os.path.exists(os.path.join(PROGRAMMORDNER, "unins000.exe"))
|
||||
alter_uninstaller = os.path.join(PROGRAMMORDNER, "unins000.exe")
|
||||
if os.path.exists(alter_uninstaller):
|
||||
subprocess.run([alter_uninstaller, "/VERYSILENT", "/SUPPRESSMSGBOXES",
|
||||
|
|
@ -172,6 +179,13 @@ pruefe(os.path.isdir(RAVOKK),
|
|||
# ---- Aufraeumen ---------------------------------------------------------
|
||||
if os.path.exists(probe):
|
||||
os.remove(probe)
|
||||
if war_installiert:
|
||||
# So hinterlassen, wie es vorgefunden wurde.
|
||||
subprocess.run([setup, "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART"],
|
||||
capture_output=True)
|
||||
time.sleep(5)
|
||||
print(f" (war vorher installiert - wieder eingerichtet: "
|
||||
f"{os.path.isdir(PROGRAMMORDNER)})")
|
||||
for d in gesichert:
|
||||
ziel = os.path.join(RAVOKK, d)
|
||||
if not os.path.exists(ziel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue