fix(dist): stop stripping .py sources; wipe payload on NSIS upgrade
Two root causes for the 'imaging extension was built for another version of Pillow' error users hit after install: 1) cleanup_site_packages ran 'find ... -name "*.py" ! -name "__init__.py" -delete' with a comment claiming 'keep .pyc only' — but no compileall step exists. Result: the dist shipped __init__.py + .pyd only, missing every submodule (Image.py, ImageDraw.py, _version.py, ...). Fresh installs were broken; in-place upgrades produced a half-old/half-new site-packages. Removed the deletion entirely. 2) NSIS installer extracted over the previous install without cleaning python/, app/, scripts/. Upgrades left stale files (old PIL/_version.py next to new PIL/_imaging.pyd) which raised the Pillow ABI mismatch. Wipe those subtrees before File /r, preserving config.yaml at the install root.
This commit is contained in:
@@ -70,6 +70,19 @@ Section "!Core (required)" SecCore
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
|
||||
; Wipe previous payload before extracting so stale files from an older
|
||||
; version cannot survive an upgrade. Without this, in-place upgrades
|
||||
; produce a half-old/half-new site-packages — e.g. an old PIL/_version.py
|
||||
; alongside a new PIL/_imaging.pyd, which raises "_imaging extension was
|
||||
; built for another version of Pillow" at runtime. config.yaml lives at
|
||||
; $INSTDIR root and is preserved.
|
||||
RMDir /r "$INSTDIR\python"
|
||||
RMDir /r "$INSTDIR\app"
|
||||
RMDir /r "$INSTDIR\scripts"
|
||||
Delete "$INSTDIR\${EXENAME}"
|
||||
Delete "$INSTDIR\VERSION"
|
||||
Delete "$INSTDIR\config.example.yaml"
|
||||
|
||||
; Copy entire distribution
|
||||
File /r "dist\media-server\*.*"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user