Add folder plugins to the enviroment variable DYLD_LIBRARY_PATH.
This commit is contained in:
@ -59,13 +59,18 @@ func generateSSLocalLauchAgentPlist() -> Bool {
|
|||||||
arguments.append("--reuse-port")
|
arguments.append("--reuse-port")
|
||||||
|
|
||||||
// For a complete listing of the keys, see the launchd.plist manual page.
|
// For a complete listing of the keys, see the launchd.plist manual page.
|
||||||
|
let dyld_library_paths = [
|
||||||
|
NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local-latest/",
|
||||||
|
NSHomeDirectory() + APP_SUPPORT_DIR + "plugins/",
|
||||||
|
]
|
||||||
|
|
||||||
let dict: NSMutableDictionary = [
|
let dict: NSMutableDictionary = [
|
||||||
"Label": "com.qiuyuzhou.shadowsocksX-NG.local",
|
"Label": "com.qiuyuzhou.shadowsocksX-NG.local",
|
||||||
"WorkingDirectory": NSHomeDirectory() + APP_SUPPORT_DIR,
|
"WorkingDirectory": NSHomeDirectory() + APP_SUPPORT_DIR,
|
||||||
"StandardOutPath": logFilePath,
|
"StandardOutPath": logFilePath,
|
||||||
"StandardErrorPath": logFilePath,
|
"StandardErrorPath": logFilePath,
|
||||||
"ProgramArguments": arguments,
|
"ProgramArguments": arguments,
|
||||||
"EnvironmentVariables": ["DYLD_LIBRARY_PATH": NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local-latest/"]
|
"EnvironmentVariables": ["DYLD_LIBRARY_PATH": dyld_library_paths.joined(separator: ":")]
|
||||||
]
|
]
|
||||||
dict.write(toFile: plistFilepath, atomically: true)
|
dict.write(toFile: plistFilepath, atomically: true)
|
||||||
let Sha1Sum = getFileSHA1Sum(plistFilepath)
|
let Sha1Sum = getFileSHA1Sum(plistFilepath)
|
||||||
|
Reference in New Issue
Block a user