27 lines
792 B
Swift
27 lines
792 B
Swift
import Sparkle
|
|
import Foundation
|
|
|
|
@MainActor
|
|
final class SparkleUpdater: NSObject, ObservableObject {
|
|
let controller: SPUStandardUpdaterController
|
|
|
|
override init() {
|
|
self.controller = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
|
|
super.init()
|
|
}
|
|
|
|
var automaticallyChecksForUpdates: Bool {
|
|
get { controller.updater.automaticallyChecksForUpdates }
|
|
set { controller.updater.automaticallyChecksForUpdates = newValue }
|
|
}
|
|
|
|
var automaticallyDownloadsUpdates: Bool {
|
|
get { controller.updater.automaticallyDownloadsUpdates }
|
|
set { controller.updater.automaticallyDownloadsUpdates = newValue }
|
|
}
|
|
|
|
func checkForUpdates() {
|
|
controller.checkForUpdates(nil)
|
|
}
|
|
}
|