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
I had the same error with two PyInstaller applications created with Version 2.0 (app1 must run app2)
I tried os.system, subprocess.call and os.startfile from app1 to run app2, all of them fail and can’t fetch information about the problem.
Finally, I rebuilt app1 with PyInstaller 1.5.1 and could run app2 (built with V 2.0) without problems.
I think to report the bug to PyInstaller Team.