The update script is spawned from inside the frozen app, so the child
inherits _PYI_APPLICATION_HOME_DIR / _PYI_ARCHIVE_FILE. Combined with
MEI dir names being derived from the pid, a new instance could end up
loading python313.dll from the directory the old process was deleting,
giving 'Failed to load Python DLL ... module not found'.
- strip _PYI_* and PYINSTALLER_* from the environment of every child
- run the new instance with its own TEMP under updates/runtime
- wait for the old processes to actually exit before swapping files
- retry the launch and verify the process is still alive
- replace Get-FileHash / Get-ChildItem -Directory with PS 2.0 safe code
The installer was spawned with DETACHED_PROCESS, which makes the
host process exit as soon as it starts, so the script body never
executed: no log, no file swap, no restart. Only CREATE_NO_WINDOW
is needed to keep the window hidden.
- stop both the bootloader and the Python child of a onefile build
- verify the script process is still alive before quitting the app
- write logs to updates/logs and always relaunch on failure