mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Initialize Sparkle on application launch and add delegate methods
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#import "native/atom_window_controller.h"
|
||||
#import "native/atom_cef_app.h"
|
||||
#import <getopt.h>
|
||||
#import <Sparkle/Sparkle.h>
|
||||
|
||||
@implementation AtomApplication
|
||||
|
||||
@@ -221,6 +222,11 @@
|
||||
}
|
||||
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
|
||||
SUUpdater.sharedUpdater.delegate = self;
|
||||
SUUpdater.sharedUpdater.automaticallyChecksForUpdates = YES;
|
||||
SUUpdater.sharedUpdater.automaticallyDownloadsUpdates = YES;
|
||||
[SUUpdater.sharedUpdater checkForUpdatesInBackground];
|
||||
|
||||
_backgroundWindowController = [[AtomWindowController alloc] initInBackground];
|
||||
if ([self.arguments objectForKey:@"benchmark"]) {
|
||||
[self runBenchmarksThenExit:true];
|
||||
@@ -260,4 +266,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark SUUpdaterDelegate
|
||||
|
||||
- (void)updaterDidNotFindUpdate:(SUUpdater *)update {
|
||||
NSLog(@"No update found");
|
||||
}
|
||||
|
||||
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update {
|
||||
NSLog(@"Found Update");
|
||||
}
|
||||
|
||||
- (void)updater:(SUUpdater *)updater willExtractUpdate:(SUAppcastItem *)update {
|
||||
NSLog(@"Extract update");
|
||||
}
|
||||
|
||||
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)update immediateInstallationInvocation:(NSInvocation *)invocation {
|
||||
NSLog(@"Install Update");
|
||||
}
|
||||
|
||||
- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)update {
|
||||
NSLog(@"Cancel Update Install");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user