From dc1afcb54f67e796afcdba51729e62e429c2e226 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Sun, 8 Nov 2026 09:29:53 -0500 Subject: [PATCH] Unpack the release's Tcl/Tk again when its pinned installer changed or the last unpack stopped. make_launcher.py reused WORK/tcltk whenever DLLs/_tkinter.pyd was there: after a new Python or Tcl/Tk pin the old files went into the release while its runtime id said new ones did, and an msiexec run cut short after that file was written was trusted too. A stamp naming the msi, written once the unpack is complete, now decides. Co-Authored-By: Claude Opus 5.5 --- tools/make_launcher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/make_launcher.py b/tools/make_launcher.py index 01fd256b..198abb29 100644 --- a/tools/make_launcher.py +++ b/tools/make_launcher.py @@ -113,10 +113,13 @@ def version(): # ---------------------------------------------------------------- python/ def tcltk_files(): + """The Tcl/Tk files of the pinned msi, unpacked into WORK/tcltk once. The stamp names the msi they came from and + is written last: an unpack from an older pin, or one stopped after _tkinter.pyd was written, is done again.""" dest = WORK / 'tcltk' - if (dest / 'DLLs' / '_tkinter.pyd').is_file(): - return dest msi = fetch('tcltk') + stamp, want = dest / '.unpacked-from', f'{msi.name} {msi.stat().st_size}' + if (dest / 'DLLs' / '_tkinter.pyd').is_file() and stamp.is_file() and stamp.read_text() == want: + return dest shutil.rmtree(dest, ignore_errors=True) dest.mkdir(parents=True) if os.name == 'nt': # an administrative image: copies the files, installs nothing @@ -125,6 +128,7 @@ def tcltk_files(): run(['msiextract', '-C', dest, msi], stdout=subprocess.DEVNULL) if not (dest / 'DLLs' / '_tkinter.pyd').is_file(): sys.exit(f'{dest}: no _tkinter.pyd in {msi.name}') + stamp.write_text(want) return dest