Corrected relaunch of application that should make app active right after launch.

This commit is contained in:
Dmytro Tretiakov committed 2015-07-10 15:42:38 +03:00
1 parent 7677f2d4ac
commit 211f930059
2 files changed
+12 -5

No files matched your search

+9 -1
View File
@@ -128,7 +128,15 @@ static const NSTimeInterval SUParentQuitCheckInterval = .25;
appPath = self.executablepath;
else
appPath = self.installationPath;
[[NSWorkspace sharedWorkspace] openFile:appPath];
NSError *error = nil;
[[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL fileURLWithPath:appPath]
options:NSWorkspaceLaunchNewInstance
configuration:nil error:&error];
if (error.code != noErr)
{
SULog(@"%ld - %@", error.code, error.localizedDescription);
}
}
if (self.folderpath)
+3 -4
View File
@@ -304,9 +304,8 @@ static void peer_event_handler(xpc_connection_t peer, xpc_object_t event)
else if (type == XPC_TYPE_DICTIONARY)
{
// Handle the message.
SUInstallServiceTask task = (SUInstallServiceTask)xpc_dictionary_get_int64(event, SUInstallServiceTaskTypeKey);
NSLog(@"XPC Installer: should start task with id = %lld", (int64_t)task);
int64_t task = xpc_dictionary_get_int64(event, SUInstallServiceTaskTypeKey);
NSLog(@"XPC Installer: will do the task %lld", (int64_t)task);
xpc_object_t reply = NULL;
@@ -334,7 +333,7 @@ static void peer_event_handler(xpc_connection_t peer, xpc_object_t event)
default:
{
SULog(@"XPC Install Service: Unknown XPC service task %lld", (int64_t)task);
SULog(@"XPC Install Service: Unknown XPC service task %lld", task);
reply = xpc_dictionary_create_reply(event);
xpc_dictionary_set_int64(reply, SUInstallServiceErrorCodeKey, (int64_t)SUXPCServiceError);