2022-06-25 09:59:32 +00:00
|
|
|
//
|
|
|
|
// Constants+Launcher.swift
|
|
|
|
// Passepartout
|
|
|
|
//
|
|
|
|
// Created by Davide De Rosa on 6/25/22.
|
2024-01-14 13:34:21 +00:00
|
|
|
// Copyright (c) 2024 Davide De Rosa. All rights reserved.
|
2022-06-25 09:59:32 +00:00
|
|
|
//
|
|
|
|
// https://github.com/passepartoutvpn
|
|
|
|
//
|
|
|
|
// This file is part of Passepartout.
|
|
|
|
//
|
|
|
|
// Passepartout is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Passepartout is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
extension Constants {
|
|
|
|
enum Launcher {
|
2022-07-03 18:46:30 +00:00
|
|
|
static let appId: String = bundleConfig("app_id")
|
2022-06-25 09:59:32 +00:00
|
|
|
|
2022-06-25 16:41:08 +00:00
|
|
|
private static let appPath: String = {
|
|
|
|
let path = Bundle.main.bundlePath as NSString
|
|
|
|
var components = path.pathComponents
|
2022-06-25 22:23:13 +00:00
|
|
|
|
|
|
|
// Passepartout.app/Contents/Library/LoginItems/PassepartoutLauncher.app
|
2022-06-25 16:41:08 +00:00
|
|
|
components.removeLast(4)
|
2022-06-25 22:23:13 +00:00
|
|
|
|
2022-06-25 16:41:08 +00:00
|
|
|
return NSString.path(withComponents: components)
|
2022-06-25 09:59:32 +00:00
|
|
|
}()
|
2022-06-25 16:41:08 +00:00
|
|
|
|
|
|
|
static let appURL = URL(fileURLWithPath: appPath)
|
2022-06-25 09:59:32 +00:00
|
|
|
}
|
|
|
|
}
|