Skip to content

Commit

Permalink
feat: use Jamf Pro's preference plist to set storePath
Browse files Browse the repository at this point in the history
Signed-off-by: ryan-alectrona <[email protected]>
  • Loading branch information
ryangball committed Oct 31, 2024
1 parent 9a7476a commit 11265b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion migrator/AppContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ struct AppContext {
]

/// Path the Jamf Self Service .app
static let storePath: String = "/Applications/Company Self Service.app"
static let fallbackStorePath: String = "/Applications/Company Self Service.app"

/// Returns the path to the Jamf Self Service .app configured on the user's device OR the fallbackStorePath
/// Reads the plist at /Library/Preferences/com.jamfsoftware.jamf.plist to get the path.
static var storePath: String {
let jamfUserDefaults = UserDefaults(suiteName: "com.jamfsoftware.jamf")
let jamfSelfServicePath = jamfUserDefaults?.string(forKey: "self_service_app_path")
return jamfSelfServicePath ?? fallbackStorePath
}

/// A URL to redirect users to setup instructions if the app detects the device is not managed by MDM.
static let enrollmentRedirectionLink: String = "https://url.to.enrollment/support.website"
Expand Down

0 comments on commit 11265b1

Please sign in to comment.