Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Sparkle for updates #950

Merged
merged 4 commits into from
Jun 17, 2022
Merged

Sparkle for updates #950

merged 4 commits into from
Jun 17, 2022

Conversation

r-darwish
Copy link
Owner

Fixes #657

Standards checklist:

  • The PR title is descriptive.
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself
    • I also tested that Topgrade skips the step where needed

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
Copy link
Owner Author

@kmplngj @dec0dOS can you please test this change?

@kmplngj
Copy link

kmplngj commented Jun 5, 2022

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.

src/steps/os/macos.rs Show resolved Hide resolved
@andreiborisov
Copy link

andreiborisov commented Jun 10, 2022

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: Homebrew/homebrew-cask#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
Copy link
Owner Author

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

@r-darwish r-darwish merged commit 4e6f48c into master Jun 17, 2022
@r-darwish r-darwish deleted the r-darwish/issue657 branch June 17, 2022 08:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sparkle for updates
3 participants