Skip to content

Commit e8dadfd

Browse files
Simone Manganellirentzsch
Simone Manganelli
authored andcommitted
Sparkle now correctly relaunches WebKit instead of Safari after installing an update
Signed-off-by: Jonathan 'Wolf' Rentzsch <[email protected]>
1 parent 6b60d2d commit e8dadfd

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Plugin/Plugin.m

+5-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ - (id) initWithArguments:(NSDictionary *)arguments
9090
{
9191
self = [super init];
9292
if (self) {
93-
[[SparkleManager sharedManager] startAutomaticallyCheckingForUpdates];
93+
SparkleManager *sharedSparkleManager = [SparkleManager sharedManager];
94+
NSWorkspace *sharedWorkspace = [NSWorkspace sharedWorkspace];
95+
NSString *pathToRelaunch = [sharedWorkspace absolutePathForAppBundleWithIdentifier:[self launchedAppBundleIdentifier]];
96+
[sharedSparkleManager setPathToRelaunch:pathToRelaunch];
97+
[sharedSparkleManager startAutomaticallyCheckingForUpdates];
9498

9599
if (![[NSUserDefaults standardUserDefaults] objectForKey:sAutoLoadInvisibleFlashViewsKey]) {
96100
// Default to auto-loading invisible flash views.

SparkleManager.h

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
@interface SparkleManager : NSObject {
3232
SUUpdater *_updater;
3333
BOOL _canUpdate;
34+
NSString *_pathToRelaunch;
3435
}
3536

3637
+ (id)sharedManager;
@@ -39,4 +40,6 @@
3940
- (void)startAutomaticallyCheckingForUpdates;
4041
- (void)checkForUpdates;
4142

43+
@property (retain) NSString *pathToRelaunch;
44+
4245
@end

SparkleManager.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ - (void)checkForUpdates {
117117
}
118118

119119
- (NSString*)pathToRelaunchForUpdater:(SUUpdater*)updater {
120-
return [[NSBundle mainBundle] bundlePath];
120+
return _pathToRelaunch;
121121
}
122122

123+
@synthesize pathToRelaunch = _pathToRelaunch;
124+
123125
@end

0 commit comments

Comments
 (0)