Skip to content

Commit

Permalink
Warn against abusing installUpdatesIfAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Mar 9, 2017
1 parent 72ee4aa commit 3809da2
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Sparkle/SUUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,30 @@ SU_EXPORT @interface SUUpdater : NSObject
@property (nonatomic, copy) NSString *decryptionPassword;

/*!
Checks for updates and, if available, immediately downloads and installs them.
This function ignores normal update schedule, ignores user preferences,
and interrupts users with an unwanted immediate app update.
WARNING: this function should not be used in regular apps. This function
is a user-unfriendly hack only for very special cases, like unstable
rapidly-changing beta builds that would not run correctly if they were
even one day out of date.
Instead of this function you should set `SUAutomaticallyUpdate` to `YES`,
which will gracefully install updates when the app quits.
For UI-less/daemon apps that aren't usually quit, instead of this function,
you can use the delegate method
SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation:
to immediately start installation when an update was found.
A progress dialog is shown but the user will never be prompted to read the
release notes.
This function will cause update to be downloaded twice if automatic updates are
enabled.
You may want to respond to the userDidCancelDownload delegate method in case
the user clicks the "Cancel" button while the update is downloading.
If you are writing a UI-less background application, you probably want to instead use
SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation:
*/
- (void)installUpdatesIfAvailable;

Expand Down

0 comments on commit 3809da2

Please sign in to comment.