Skip to content

Commit

Permalink
allow major upgrades if actionButtonPath is set
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Nov 22, 2021
1 parent 955e6bb commit 5a303d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Nudge/UI/Main.swift
Expand Up @@ -88,6 +88,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
self.runSoftwareUpdate()
if Utils().requireMajorUpgrade() {
if actionButtonPath != nil {
if !actionButtonPath!.isEmpty {
return
} else {
let msg = "actionButtonPath contains empty string - actionButton will be unable to trigger any action required for major upgrades"
prefsProfileLog.warning("\(msg, privacy: .public)")
return
}
if attemptToFetchMajorUpgrade == true && fetchMajorUpgradeSuccessful == false && (majorUpgradeAppPathExists == false && majorUpgradeBackupAppPathExists == false) {
let msg = "Unable to fetch major upgrade and application missing, exiting Nudge"
uiLog.error("\(msg, privacy: .public)")
Expand Down
4 changes: 4 additions & 0 deletions Nudge/Utilities/SoftwareUpdate.swift
Expand Up @@ -54,6 +54,10 @@ class SoftwareUpdate {
}

if Utils().requireMajorUpgrade() {
if actionButtonPath != nil {
return
}

if attemptToFetchMajorUpgrade == true {
if majorUpgradeAppPathExists {
let msg = "found major upgrade application - skipping download"
Expand Down

0 comments on commit 5a303d8

Please sign in to comment.