This commit is contained in:
2024-05-30 17:20:39 +02:00
parent d37a11fa61
commit 2e77fa0608
4 changed files with 42 additions and 13 deletions

View File

@ -5,7 +5,7 @@
import Cocoa
open class AppSelfUpdater: NSObject, NSApplicationDelegate {
open class SelfUpdater: NSObject, NSApplicationDelegate {
// MARK: - Requires Configuration
@ -41,9 +41,12 @@ open class AppSelfUpdater: NSObject, NSApplicationDelegate {
}
func installUpdate() async {
print("APP SELF-UPDATER by Nico Verbruggen")
print("Configured for \(self.appName)\n\(self.bundleIdentifiers)")
print("===========================================")
print("\(Executable.name), version \(Executable.fullVersion)")
print("Using AppUpdater by Nico Verbruggen")
print("===========================================")
print("Configured for \(self.appName) bundles: \(self.bundleIdentifiers)")
self.updaterPath = self.baseUpdaterPath
.replacingOccurrences(of: "~", with: NSHomeDirectory())
@ -171,3 +174,8 @@ open class AppSelfUpdater: NSObject, NSApplicationDelegate {
return "/Applications/\(app)"
}
}
struct ReleaseManifest: Codable {
let url: String
let sha256: String
}

View File

@ -0,0 +1,30 @@
//
// Created by Nico Verbruggen on 30/05/2024.
// Copyright © 2024 Nico Verbruggen. All rights reserved.
//
import Foundation
class Executable {
static var name: String {
Bundle.main.infoDictionary?["CFBundleName"] as! String
}
static var identifier: String {
Bundle.main.infoDictionary?["CFBundleIdentifier"] as! String
}
static var fullVersion: String {
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
let build = Bundle.main.infoDictionary?["CFBundleVersion"] as! String
return "\(version) (\(build))"
}
static var bundleVersion: String {
return Bundle.main.infoDictionary?["CFBundleVersion"] as! String
}
static var shortVersion: String {
return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
}
}

View File

@ -1,9 +0,0 @@
//
// Created by Nico Verbruggen on 26/05/2024.
// Copyright © 2024 Nico Verbruggen. All rights reserved.
//
struct ReleaseManifest: Codable {
let url: String
let sha256: String
}