@@ -190,9 +190,16 @@ - (void)registerWithSparkle {
190
190
// Background update check interval.
191
191
constexpr NSTimeInterval kBraveUpdateCheckIntervalInSec = 3 * 60 * 60 ;
192
192
[su_updater_ setUpdateCheckInterval: kBraveUpdateCheckIntervalInSec ];
193
- [su_updater_ setAutomaticallyChecksForUpdates: YES ];
193
+
194
194
[su_updater_ setAutomaticallyDownloadsUpdates: YES ];
195
195
196
+ // We only want to perform automatic update checks if we have write
197
+ // access to the installation directory. Such access can be checked
198
+ // with SUSystemUpdateInfo:systemAllowsAutomaticUpdatesForHost.
199
+ // The following makes su_updater_ call this method for us because
200
+ // we setAutomaticallyDownloadUpdates:YES above.
201
+ if ([su_updater_ automaticallyDownloadsUpdates ])
202
+ [su_updater_ setAutomaticallyChecksForUpdates: YES ];
196
203
[self updateStatus: kAutoupdateRegistered version: nil error: nil ];
197
204
}
198
205
@@ -229,7 +236,7 @@ - (void)checkForUpdates {
229
236
230
237
[self updateStatus: kAutoupdateChecking version: nil error: nil ];
231
238
232
- [su_updater_ checkForUpdatesInBackground ];
239
+ [su_updater_ checkForUpdatesInBackgroundWithoutUi ];
233
240
}
234
241
235
242
- (void )relaunch {
@@ -239,7 +246,7 @@ - (void)relaunch {
239
246
240
247
- (void )checkForUpdatesInBackground {
241
248
DCHECK (registered_);
242
- [su_updater_ checkForUpdatesInBackground ];
249
+ [su_updater_ checkForUpdatesInBackgroundWithoutUi ];
243
250
}
244
251
245
252
- (void )updateStatus : (AutoupdateStatus)status
0 commit comments