Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for UAD updates #121

Merged
merged 6 commits into from
Feb 9, 2022
Merged

Check for UAD updates #121

merged 6 commits into from
Feb 9, 2022

Conversation

0x192
Copy link
Owner

@0x192 0x192 commented Feb 5, 2022

  • Add an update button in the About page which links to the Github Releases page
  • Display if there is a new version available in the About page
  • Display an error if the request to Github failed
  • Download the new UAD version and update the software (the hard part)
  • Display an update button instead of the Apps button if there is an update available
  • Add a no-self-updatecargo feature for this (we don't want auto-update if a package manager already handles this)

The request is done asynchronously, each time you launch UAD or press the About button
The message checking updates... is displayed in the meantime.


Update process:

  • Download the right release based on the current file name (temp_<release_name>)
  • Extract the executable from the tarball for Linux and MacOS release
  • Rename the current executable to a temp path and rename the new version as the original file name
  • Spawn a new process to run the new (renamed) executable and kill the current one
  • Remove the old executable

- Add an update button in the About page which links to the Github Releases page
- Display if there is a new version available in the About page
- Display an error if the request to Github failed

The request is done asynchronously, each time you press on the About button
The message checking updates... is displayed in the meantime.
Parallelizing tasks with Iced Commands can be tricky because there is no `join` feature.

This commit simplifies all the init logic (download UAD list, get devices info, load packages) and fix a concurrency issue where
a tasks could be starting when it should have waited for another task to finish.

Add a state for the `List` module: `Ready` or `Loading(LoadingState)`
@0x192 0x192 reopened this Feb 8, 2022
Asynchronously check for updates and display a button update instead of the `Apps` button if an update is available

Update process:
- Download the right release based on the current file name (temp_<release_name>)
- Extract the executable from the tarball for Linux and MacOS release
- Rename the current executable to a temp path and rename the new version as the original file name
- Spawn a new process to run the new (renamed) executable and kill the current one
- Remove the old executable

 `self-update` is a new default cargo feature. It can be disabled with the `--no-default-features` flag.
@0x192 0x192 marked this pull request as ready for review February 9, 2022 22:57
@0x192 0x192 merged commit 4659eb7 into main Feb 9, 2022
@0x192 0x192 deleted the self-update branch May 22, 2022 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant