Skip to content

Commit

Permalink
Sparkle now correctly relaunches WebKit instead of Safari after insta…
Browse files Browse the repository at this point in the history
…lling an update

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information
Simone Manganelli authored and rentzsch committed May 5, 2009
1 parent 6b60d2d commit e8dadfd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ - (id) initWithArguments:(NSDictionary *)arguments
{
self = [super init];
if (self) {
[[SparkleManager sharedManager] startAutomaticallyCheckingForUpdates];
SparkleManager *sharedSparkleManager = [SparkleManager sharedManager];
NSWorkspace *sharedWorkspace = [NSWorkspace sharedWorkspace];
NSString *pathToRelaunch = [sharedWorkspace absolutePathForAppBundleWithIdentifier:[self launchedAppBundleIdentifier]];
[sharedSparkleManager setPathToRelaunch:pathToRelaunch];
[sharedSparkleManager startAutomaticallyCheckingForUpdates];

if (![[NSUserDefaults standardUserDefaults] objectForKey:sAutoLoadInvisibleFlashViewsKey]) {
// Default to auto-loading invisible flash views.
Expand Down
3 changes: 3 additions & 0 deletions SparkleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@interface SparkleManager : NSObject {
SUUpdater *_updater;
BOOL _canUpdate;
NSString *_pathToRelaunch;
}

+ (id)sharedManager;
Expand All @@ -39,4 +40,6 @@
- (void)startAutomaticallyCheckingForUpdates;
- (void)checkForUpdates;

@property (retain) NSString *pathToRelaunch;

@end
4 changes: 3 additions & 1 deletion SparkleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ - (void)checkForUpdates {
}

- (NSString*)pathToRelaunchForUpdater:(SUUpdater*)updater {
return [[NSBundle mainBundle] bundlePath];
return _pathToRelaunch;
}

@synthesize pathToRelaunch = _pathToRelaunch;

@end

0 comments on commit e8dadfd

Please sign in to comment.