I have programs packed by pyinstaller with --onefile mode on windows. one for main process and one for toolkit, and I want update them on the fly.
I plan the update flow like below:
- When main process exe startup, check if there a patch file. If does, copy toolkit to update.exe, and start "update.exe upgrade" on detached mode. The main process quickly quit and let the update.exe do its job.
- update.exe is never in the package, so it can do the replace job well.
- after that, update.exe start the main process exe, also detached mode.
I think it should work, but the program doesn't start another one.
Codes to start detached process:
subprocess.Popen(command, stdin=None, stdout=None, stderr=None, close_fds=True,
creationflags=0x00000008)
The codes works when start a pyinstaller exe by python script, and start a normal program like memcached.exe by a pyinstaller exe. It seems just program packed by pyinstaller can't start another one.
Is there a way to fix it, or other solutions for update
updated: This is a bug in pyinstaller2.0, it has been fixed in the latest dev branch. http://www.pyinstaller.org/ticket/569