GrandOrgue / grandorgue

GrandOrgue software
Other
148 stars 40 forks source link

Added checking for updates at startup #1844

Closed nanoufo closed 3 months ago

nanoufo commented 3 months ago

popup

Visible changes

At startup, GO asynchronously checks GitHub releases for updates. If it finds a new version, it displays a modal dialog with the latest release and its description. Clicking on the download button opens the browser with the releases page. If no updates are found, a message is added to the Log Messages window.

By default, update checking is enabled. However, if these pop-ups become annoying, they can be quickly disabled by unchecking the 'Check for updates at startup' checkbox. Update checking can also be enabled or disabled in the settings on the Options tab.

Resolves: #704 .

Implementation

The application uses libcurl for calls to the GitHub API as wxHttp cannot be used due to its lack of TLS support. On Linux, the system libcurl is utilized, while for Windows, a pre-built libcurl with all dependencies is downloaded from the MSYS2 repositories ( is this acceptable?).

Testing

The application has been tested on both Linux and Windows platforms. Binaries were built on a local machine with a modified GO version. Building for MacOS seems to work in Github Actions, but it has not been tested yet.

rousseldenis commented 3 months ago

I would say notifications should be done silently by adding a text or icon to the main bar for instance:

image

And I tend to opt for a manual check too in the Help section

oleg68 commented 3 months ago

I suggest.

@rousseldenis @larspalo do you agree with this approach?

larspalo commented 3 months ago

@oleg68 Your suggestions would give an acceptable behaviour even though a separate menu item and a more manual procedure of checking with only discreet automatic hints would be a better general approach, I think. However, I'd like to add to the requirements that even if the automatic update checking is enabled - a failed check, for instance if no internet is available should be handled gracefully.

nanoufo commented 3 months ago

As of now,

  1. The update checker posts debug messages that may be seen in Log Messages window in GO debug builds.
  2. Update checking may be performed at startup. If it fails, it does so silently. If a new update is found, the user will be notified by the addition of a new menu. The menu contains a 'Download' item that opens the releases page in the browser. Other items simply open a large popup window. screenshot
  3. A menu item labeled 'Check for Updates' can be found in the 'Help' menu. Clicking on it initiates the update checking process. While the checking is in progress, the mouse cursor displays a 'busy' icon. If a new update is detected, a large popup window is displayed. Otherwise, a wxMessageBox is shown to describe the results.
oleg68 commented 3 months ago

I tested the new version.

The new menu item is acceptable.

But when the menu item shows update v3.12.0-0.local -> 3.13.3-1, the Show changelog displays only the changelog of the lastt release only: 3.13.3-1.

It would be better to show changelog of all versions from 3.12.1 -> 3.13.3-1.

larspalo commented 3 months ago

I like the current version, there are some small things that Oleg already pointed out (some of which are more important than others)... But, as a whole I like the approach and can even live with a default to true for the automatic check at startup as it probably will make it easier for new GO users to begin with.

oleg68 commented 3 months ago

@nanoufo Seems now everything works as expected.

The only things to do are

oleg68 commented 3 months ago

@nanoufo Could you enable a help button (it is supported in GODialog automatically) in the Changelog window? You also have to add a description of this window in the help.

nanoufo commented 3 months ago

@nanoufo Could you enable a help button (it is supported in GODialog automatically) in the Changelog window? You also have to add a description of this window in the help.

I don't think that a simple window like this needs a help page. Writing instructions for every UI element seems like a waste of time.

oleg68 commented 3 months ago

@nanoufo I'm approving this PR but you should to resolve the conflict prior merging this pr.

oleg68 commented 3 months ago

@rousseldenis @larspalo could you take a look to the latest version of the updater? May we merge it?