|
|
@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
#include <signal.h> |
|
|
|
#import <Foundation/Foundation.h> |
|
|
|
#import <AppKit/NSWorkspace.h> |
|
|
|
#import "pEpMacOSAdapter.h" |
|
|
|
#import "pEpUpdater.h" |
|
|
|
|
|
|
@ -53,6 +54,14 @@ pEpUpdater* updater = nil; |
|
|
|
|
|
|
|
@end |
|
|
|
|
|
|
|
BOOL start_helper(void) |
|
|
|
{ |
|
|
|
NSURL *url = [NSURL |
|
|
|
fileURLWithPath:@"/Library/Application Support/pEp/pEp.app/Contents/Library/LoginItems/p≡p updates.app"]; |
|
|
|
|
|
|
|
return [[NSWorkspace sharedWorkspace] openURL:url]; |
|
|
|
} |
|
|
|
|
|
|
|
void signal_TERM(int signal) |
|
|
|
{ |
|
|
|
NSLog(@"stopping agent"); |
|
|
@ -73,6 +82,10 @@ int main(int argc, const char *argv[]) |
|
|
|
listener.delegate = delegate; |
|
|
|
[listener resume]; |
|
|
|
|
|
|
|
// start the GUI helper app |
|
|
|
BOOL opened = start_helper(); |
|
|
|
assert(opened); |
|
|
|
|
|
|
|
NSLog(@"going into main runLoop"); |
|
|
|
NSRunLoop* runLoop = [NSRunLoop currentRunLoop]; |
|
|
|
[runLoop run]; |
|
|
|