Skip to content

Commit

Permalink
Fix for launcher item
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsochantaris committed Aug 11, 2023
1 parent 6927f4b commit cbd8fca
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Trailer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1691;
CURRENT_PROJECT_VERSION = 1693;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -1637,7 +1637,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.8.6;
MARKETING_VERSION = 1.8.7;
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "-D DEBUG";
SWIFT_ENFORCE_EXCLUSIVE_ACCESS = "debug-only";
Expand Down Expand Up @@ -1675,7 +1675,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1691;
CURRENT_PROJECT_VERSION = 1693;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
Expand All @@ -1699,7 +1699,7 @@
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.8.6;
MARKETING_VERSION = 1.8.7;
SEPARATE_STRIP = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_DISABLE_SAFETY_CHECKS = YES;
Expand Down
12 changes: 10 additions & 2 deletions TrailerLauncher/LauncherCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ enum LauncherCommon {

static func launchMainApp() {
if isMainAppRunning { return }
let path = "/" + Bundle.main.bundlePath.split(separator: "/").dropLast(3).joined(separator: "/") + "/MacOS/Trailer"
NSWorkspace.shared.open(URL(fileURLWithPath: path), configuration: NSWorkspace.OpenConfiguration())
var finalPathComponents = [String.SubSequence]()
for component in Bundle.main.bundlePath.split(separator: "/") {
finalPathComponents.append(component)
if component.hasSuffix(".app") {
break
}
}
let path = "/" + finalPathComponents.joined(separator: "/")
let config = NSWorkspace.OpenConfiguration()
NSWorkspace.shared.openApplication(at: URL(fileURLWithPath: path), configuration: config) { _, _ in }
}
}
12 changes: 8 additions & 4 deletions TrailerLauncher/TrailerLauncher.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.Trailer</string>
</array>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

0 comments on commit cbd8fca

Please sign in to comment.