2019-02-19 15:13:52 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-12-04 11:15:29 +00:00
|
|
|
// Copyright © 2018-2020 WireGuard LLC. All Rights Reserved.
|
2019-02-19 15:13:52 +00:00
|
|
|
|
|
|
|
#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;
|
|
|
|
}
|