mirror of
https://github.com/nicoverbruggen/NVAppUpdater.git
synced 2025-08-07 17:50:07 +02:00
Cleanup
This commit is contained in:
@ -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
|
||||
}
|
30
Sources/AppUpdater/Support/Executable.swift
Normal file
30
Sources/AppUpdater/Support/Executable.swift
Normal 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
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
Reference in New Issue
Block a user