Merge pull request #509 from grahammiln/launch-services

Register update with Launch Services; see #508
This commit is contained in:
Kornel committed 2015-04-01 11:20:16 +01:00
commit ddde2822fa
1 file changed
+14
+14
View File
@@ -162,10 +162,24 @@ static NSString *sUpdateFolder = nil;
}
}
+ (void)registerWithLaunchServices:(NSString *)installationPath
{
NSURL* installationURL = [NSURL fileURLWithPath:(NSString*)installationPath];
if (installationURL != nil)
{
OSStatus registerStatus = LSRegisterURL((__bridge CFURLRef)installationURL,true);
if (registerStatus != noErr)
{
SULog(@"Error: LSRegisterURL returned %d", registerStatus);
}
}
}
+ (void)finishInstallationToPath:(NSString *)installationPath withResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:(id<SUInstallerDelegate>)delegate
{
if (result)
{
[self registerWithLaunchServices:installationPath];
[self mdimportInstallationPath:installationPath];
if ([delegate respondsToSelector:@selector(installerFinishedForHost:)]) {
dispatch_async(dispatch_get_main_queue(), ^{