Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,14 +948,16 @@ def _restart_app(self):
program = sys.executable
args = [script] + pdf_args
cwd = os.path.dirname(script) or os.getcwd()
# PyInstaller --onefile sets _MEIPASS2 to its temp extraction
# folder. The parent deletes that folder on exit, so the child
# must perform its own extraction instead of reusing ours.
# PyInstaller --onefile points _PYI_APPLICATION_HOME_DIR (or the
# legacy _MEIPASS2) at our temp extraction folder. The parent
# deletes that folder on exit, so the child must perform its
# own extraction instead of reusing ours.
proc = QProcess()
proc.setProgram(program)
proc.setArguments(args)
proc.setWorkingDirectory(cwd)
env = QProcessEnvironment.systemEnvironment()
env.remove("_PYI_APPLICATION_HOME_DIR")
env.remove("_MEIPASS2")
proc.setProcessEnvironment(env)
proc.startDetached()
Expand Down
Loading