mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 16:49:58 -04:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -113,10 +113,13 @@ def version():
|
|||||||
# ---------------------------------------------------------------- python/
|
# ---------------------------------------------------------------- python/
|
||||||
|
|
||||||
def tcltk_files():
|
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'
|
dest = WORK / 'tcltk'
|
||||||
if (dest / 'DLLs' / '_tkinter.pyd').is_file():
|
|
||||||
return dest
|
|
||||||
msi = fetch('tcltk')
|
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)
|
shutil.rmtree(dest, ignore_errors=True)
|
||||||
dest.mkdir(parents=True)
|
dest.mkdir(parents=True)
|
||||||
if os.name == 'nt': # an administrative image: copies the files, installs nothing
|
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)
|
run(['msiextract', '-C', dest, msi], stdout=subprocess.DEVNULL)
|
||||||
if not (dest / 'DLLs' / '_tkinter.pyd').is_file():
|
if not (dest / 'DLLs' / '_tkinter.pyd').is_file():
|
||||||
sys.exit(f'{dest}: no _tkinter.pyd in {msi.name}')
|
sys.exit(f'{dest}: no _tkinter.pyd in {msi.name}')
|
||||||
|
stamp.write_text(want)
|
||||||
return dest
|
return dest
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user