Initialize SUUpdater and add check for updates menu item

This commit is contained in:
Brandon Evans 2021-01-19 19:32:38 -07:00
parent e7eea3bee1
commit b3dbb1af45
No known key found for this signature in database
GPG key ID: D58A4B8DB64F8E93
2 changed files with 18 additions and 1 deletions

View file

@ -37,5 +37,7 @@
<key>com.robotsandpencils.XcodesApp.Helper</key>
<string>identifier "com.robotsandpencils.XcodesApp.Helper" and info [CFBundleShortVersionString] &gt;= "1.0.0" and anchor apple generic and certificate leaf[subject.OU] = "$(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)"</string>
</dict>
<key>SUFeedURL</key>
<string>https://robotsandpencils.github.io/XcodesApp/appcast.xml</string>
</dict>
</plist>

View file

@ -1,5 +1,6 @@
import SwiftUI
import AppKit
import Sparkle
import SwiftUI
@main
struct XcodesApp: App {
@ -28,6 +29,11 @@ struct XcodesApp: App {
appDelegate.showAboutWindow()
}
}
CommandGroup(after: .appInfo) {
Button("Check for Updates...") {
appDelegate.checkForUpdates()
}
}
CommandGroup(after: CommandGroupPlacement.newItem) {
Button("Refresh") {
appState.update()
@ -83,4 +89,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
acknowledgementsWindow.center()
acknowledgementsWindow.makeKeyAndOrderFront(nil)
}
func checkForUpdates() {
SUUpdater.shared()?.checkForUpdates(self)
}
func applicationDidFinishLaunching(_ notification: Notification) {
// Initialize manually
SUUpdater.shared()
}
}