Extraction Initiated Manually #2452
Replies: 1 comment 4 replies
-
Sparkle always tries to run What you're trying to do is incorrect; the user driver should not be trying to start downloading the update automatically behind the user's back. Instead, if you don’t want to show the update downloading, opt into Normally with this automatic setting, Sparkle tries to silently install the update on quit without notifying the user, but there are a few cases where Sparkle will show the update (via your user driver) to the user. One of these cases is when the update requires authorization, which is always the case for pkg installs. Here you may see that the update's stage is already Side note: pkg installations are generally discouraged on macOS; there are many developers that use them and really shouldn't be using them. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I was wondering if it is possible to programmatically trigger extracting the archive after it was already downloaded. After messing around for a while, it appears that there isn't currently a way to wait or pause before manually invoking to extract the update.
I have been working on implementing my own programmatic UI set up in Swift for my application using SPUUpdaterDelegate and SPUUserDriver. All of this works out great, although I cannot create my own trigger for extracting the update without hanging the UI with the rainbow spinner of death.
This goes back to the issue of the application being owned by the system (root) instead of the user.
Sparkle is able to download the update without elevated permissions, but extracting the archive will always throw up a pop up asking the user for their password.
Now, I know that using a PKG installer will, by default, write the app to /Applications as root, which is why this is happening. I have already 'fixed' my PKG installer by changing the ownership within a post-installation script (which will prompt the user for their password upon installation).
After 'fixing' my installer, If I automatically download and extract the update in the background, I can throw up a button that will allow the user to just click to install and restart upon handling the 'reply' (kinda like the Squirrel Framework or Google's OMAHA) by utilizing:
func showReadyToInstallAndRelaunch() async -> SPUUserUpdateChoice
Which will wait asynchronously for a trigger.
However, my existing users are subjected to my past ignorance, and if an update starts downloading automatically in the background without them knowing about it, they will get a random password prompt without triggering anything themselves, which I would think looks a little shady to the user.
What I would love to do in this case, is have the ability to have the update downloaded, but then throw up something in the UI to allow the user to trigger the extraction which will throw up the password prompt, then install and restart all in one click of a button after the user enters their password.
If anyone has ideas or recommendations to handle this case, I would be open to trying them out!
If none of this is possible, I will have my app check for an available update and if it finds one, then prompt the user to click a button to download/extract, then prompt them to install/restart in the case that the app is owned by system (root). This would be a two step process like how sparkle works by default with its built in pop ups. Wanted to avoid that if I could!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions