Skip to content

Commit cb3d01e

Browse files
committed
Add Info.plist for Sparkle update support and configure project settings
- Created Info.plist to enable automatic updates via Sparkle for ContainerUI. - Configured the project to reference the new Info.plist file for update feed and settings. - Integrated update check functionality in the app's command menu for user convenience.
1 parent 8a92e62 commit cb3d01e

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

ContainerUI/ContainerUI.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@
467467
ENABLE_RESOURCE_ACCESS_USB = NO;
468468
ENABLE_USER_SELECTED_FILES = readwrite;
469469
GENERATE_INFOPLIST_FILE = YES;
470+
INFOPLIST_FILE = ContainerUI/Info.plist;
470471
INFOPLIST_KEY_CFBundleDisplayName = ContainerBay;
471472
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
472473
INFOPLIST_KEY_NSHumanReadableCopyright = "";
@@ -509,6 +510,7 @@
509510
ENABLE_RESOURCE_ACCESS_USB = NO;
510511
ENABLE_USER_SELECTED_FILES = readwrite;
511512
GENERATE_INFOPLIST_FILE = YES;
513+
INFOPLIST_FILE = ContainerUI/Info.plist;
512514
INFOPLIST_KEY_CFBundleDisplayName = ContainerBay;
513515
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
514516
INFOPLIST_KEY_NSHumanReadableCopyright = "";

ContainerUI/ContainerUI/Application/ContainerUIApp.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@
77
//
88

99
import SwiftUI
10+
import Sparkle
1011

1112
@main
1213
struct ContainerUIApp: App {
1314
@State private var containerService = ContainerService()
15+
private let updaterController: SPUStandardUpdaterController
16+
17+
init() {
18+
updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
19+
}
1420

1521
var body: some Scene {
1622
WindowGroup {
@@ -33,5 +39,13 @@ struct ContainerUIApp: App {
3339
.windowResizability(.contentSize)
3440
.windowStyle(.titleBar)
3541
.defaultSize(width: 800, height: 600)
42+
.commands {
43+
CommandGroup(after: .appInfo) {
44+
Button("Check for Updates...") {
45+
updaterController.updater.checkForUpdates()
46+
}
47+
.keyboardShortcut("u", modifiers: .command)
48+
}
49+
}
3650
}
3751
}

ContainerUI/ContainerUI/Info.plist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SUEnableAutomaticChecks</key>
6+
<true/>
7+
<key>SUFeedURL</key>
8+
<string>https://raw.githack.com/lcandy2/container-ui/main/update-feed/appcast.xml</string>
9+
<key>SUPublicEDKey</key>
10+
<string>ERqmcx7u1eb3HqeCf9M3SGPEFJthJtTHb4O/H+r4Jp0=</string>
11+
<key>SUScheduledCheckInterval</key>
12+
<integer>86400</integer>
13+
</dict>
14+
</plist>

0 commit comments

Comments
 (0)