r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.37k stars 162 forks source link

Sparkle for updates #950

Closed r-darwish closed 2 years ago

r-darwish commented 2 years ago

Fixes #657

Standards checklist:

If you developed a feature or a bug fix for someone else and you do not have the means to test it, please tag this person here.

r-darwish commented 2 years ago

@kmplngj @dec0dOS can you please test this change?

kmplngj commented 2 years ago

Thanks for the work!

Here are my observations:

  1. First I had to find out that I had to load the sparkle dev release and load the sparke.app into my application folder. I don't know if there would be a nicer way perhaps a help good help message would work for this.
  2. macOS is annoying if you haven't even opened the sparkle.app before.
  3. sparkle CLI command arguments seems to be wrong. I tested the sparkle CLI successfully with this command /Applications/Sparkle.app/Contents/MacOS/sparkle --check /Applications/HandBrake.app/
  4. I would also add the --interactive since some apps need this.
  5. Would be cool to get a success message. Errors are shows.

I made some changes and get this.

`―― 22:27:19 - Sparkle ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― Try to update "/Applications/Vimac.app" Try to update "/Applications/sparkle.app" Error: Update has failed due to error 4 (SUSparkleErrorDomain). You must specify the URL of the appcast as the SUFeedURL key in either the Info.plist, or with -feedURLStringForUpdater: delegate method, or by the user defaults of sparkle! Try to update "/Applications/Sparkle Test App.app" Error: Update has failed due to error 2001 (SUSparkleErrorDomain). An error occurred in retrieving update information. Please try again later. Try to update "/Applications/Bunch.app" Try to update "/Applications/HandBrake.app" Try to update "/Applications/Paw.app" Error: Update has failed due to error 4 (SUSparkleErrorDomain). You must specify the URL of the appcast as the SUFeedURL key in either the Info.plist, or with -feedURLStringForUpdater: delegate method, or by the user defaults of Paw! Try to update "/Applications/TeamViewer.app" Try to update "/Applications/Rectangle.app" Try to update "/Applications/IINA.app" Try to update "/Applications/Menuwhere.app" Try to update "/Applications/SwiftBar.app" Error: Update has failed due to error 4 (SUSparkleErrorDomain). You must specify the URL of the appcast as the SUFeedURL key in either the Info.plist, or with -feedURLStringForUpdater: delegate method, or by the user defaults of SwiftBar! Try to update "/Applications/Sleeve.app" Try to update "/Applications/DaisyDisk.app" Try to update "/Applications/ForkLift.app" Try to update "/Applications/Docker.app" Error: Update has failed due to error 4 (SUSparkleErrorDomain). You must specify the URL of the appcast as the SUFeedURL key in either the Info.plist, or with -feedURLStringForUpdater: delegate method, or by the user defaults of Docker! Try to update "/Applications/Pika.app" Try to update "/Applications/Syntax Highlight.app" Try to update "/Applications/Fork.app" Try to update "/Applications/MacDown.app" Try to update "/Applications/KeyCastr.app" Try to update "/Applications/8BitDo Firmware Updater.app" Error: Update has failed due to error 4005 (SUSparkleErrorDomain). The update is improperly signed and could not be validated. Please try again later or contact the app developer. Try to update "/Applications/Ukelele.app" Try to update "/Applications/MonitorControl.app" Try to update "/Applications/iTerm.app" Try to update "/Applications/kindaVim.app" Try to update "/Applications/OpenEmu.app" Try to update "/Applications/Soulver 3.app"

―― 22:27:42 - Summary ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― Sparkle: OK`

Handbrake was updated after this.

andreiborisov commented 2 years ago

Here is how I've been doing it successfully on my machine: https://github.com/andreiborisov/sparkle-update/blob/main/functions/sparkle-update.fish

tldr:

  1. List all apps in the Applications folder.
  2. Run sparkle --probe for the apps.
  3. Run sparkle --check-immediately for the those who returned successfully in the step 2.

Better heuristics instead of the step 2 would be nice of course, but not strictly necessary...?

Also I've submitted a PR so the CLI would be installable via Homebrew: https://github.com/Homebrew/homebrew-cask/pull/125356, so you probably would want to change the way you call it (it will be available in PATH as sparkle if installed after the PR has landed).

r-darwish commented 2 years ago

@andreiborisov I just pushed an update according to your suggestions.