2019-02-19 15:13:52 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved.
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2019-05-20 08:34:47 +00:00
|
|
|
NSString *appIdInfoDictionaryKey = @"com.wireguard.macos.app_id";
|
|
|
|
NSString *appId = [NSBundle.mainBundle objectForInfoDictionaryKey:appIdInfoDictionaryKey];
|
2019-02-19 15:13:52 +00:00
|
|
|
|
2019-05-20 08:34:47 +00:00
|
|
|
NSString *launchCode = @"LaunchedByWireGuardLoginItemHelper";
|
|
|
|
NSAppleEventDescriptor *paramDescriptor = [NSAppleEventDescriptor descriptorWithString:launchCode];
|
2019-02-19 15:13:52 +00:00
|
|
|
|
2019-05-20 08:34:47 +00:00
|
|
|
[NSWorkspace.sharedWorkspace launchAppWithBundleIdentifier:appId options:NSWorkspaceLaunchWithoutActivation
|
|
|
|
additionalEventParamDescriptor:paramDescriptor launchIdentifier:NULL];
|
2019-02-19 15:13:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|