2019-02-19 15:13:52 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2021-06-17 14:56:46 +00:00
|
|
|
// Copyright © 2018-2021 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;
|
|
|
|
}
|