What is the proper way to apply the update "gracefully"? #96
-
Ideally, I want to:
How do I achieve this? Does In the code below I check for and apply updates, if any were found. I run this code in a separate thread, so that it wouldn't block the UI and show download progress to the user. def apply_update(self):
if not self.updater_client.check_for_updates():
return
self.updater_client.download_and_apply_update(
purge_dst_dir=False,
skip_confirmation=True,
exclude_from_purge=None,
progress_hook=lambda **download_args: self.update_progress_signal.emit(download_args),
) However, when the update is downloaded, it opens up a console window, but does not close the application. The output at this moment is shown below. Also, it cannot copy files when the application is running and I have to close the application manually for the update to succeed.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Basically do what you're doing in your example above.
The That is, assuming you're on Windows.
There's a On macOS the app is already restarted out-of-the-box. See source
Tufup was not designed with multi-threading in mind. It can probably be done, but you'd have to jump through some hoops: Off the top of my head, I think you could probably run the However, use at your own risk: this is untested and not officially supported. I'm also not quite sure if, and how, the underlying
That's probably all due to the multi-threading. The |
Beta Was this translation helpful? Give feedback.
Basically do what you're doing in your example above.
The
skip_confirmation=False
takes care fo the user interaction in the console. If you also want to prevent the console window from appearing, have a look at theprocess_creation_flags
arg, as described in #90.That is, assuming you're on Windows.
There's a
batch_template
hook that allows you to provide a custom batch script. Have a look at this discussion for details.On macOS the app is already restarted out-of-the-…