setup-your-mac / Setup-Your-Mac

Setup Your Mac aims to simplify initial device configuration by leveraging swiftDialog and Jamf Pro Policy Custom Events to allow end-users to self-complete Mac setup post-enrollment.
https://snelson.us/sym
MIT License
238 stars 52 forks source link

Add version check to dialogCheck, Split out install to new function #67

Closed drtaru closed 1 year ago

drtaru commented 1 year ago

I added a minimum version check to the dialogCheck function and split out the SwiftDialog install portion to it's own function as it is now used twice.

Log output on a machine with an outdated version "2.1.0.4148" of SwiftDialog

2023-05-28 19:21:27 - PRE-FLIGHT CHECK: # # # SETUP YOUR MAC VERBOSE DEBUG MODE: Line No. 414 # # #
2023-05-28 19:21:28 - PRE-FLIGHT CHECK: swiftDialog version 2.1.0.4148 found but swiftDialog 2.2 or newer is required; updating...
2023-05-28 19:21:28 - PRE-FLIGHT CHECK: Installing SwiftDialog...
installer: Package name is
installer: Upgrading at base path /
installer: The upgrade was successful.
2023-05-28 19:21:32 - PRE-FLIGHT CHECK: swiftDialog version 2.2.0.4535 installed; proceeding...
2023-05-28 19:21:32 - PRE-FLIGHT CHECK: Complete

Log output from a machine that does not have SwiftDialog installed.

2023-05-28 19:30:03 - PRE-FLIGHT CHECK: # # # SETUP YOUR MAC VERBOSE DEBUG MODE: Line No. 414 # # #
2023-05-28 19:30:03 - PRE-FLIGHT CHECK: swiftDialog not found. Installing...
2023-05-28 19:30:03 - PRE-FLIGHT CHECK: Installing SwiftDialog...
installer: Package name is
installer: Installing at base path /
installer: The install was successful.
2023-05-28 19:30:08 - PRE-FLIGHT CHECK: swiftDialog version 2.2.0.4535 installed; proceeding...
2023-05-28 19:30:08 - PRE-FLIGHT CHECK: Complete
humanendpoint commented 1 year ago

could also do something like dialogVersion=$(echo $dialogURL | sed 's/[^\-]*-//' | sed 's/\.[^.]*$//') to avoid any version hard coding as well.

drtaru commented 1 year ago

The thought here is the hard lower limit for 1.11 is 2.2

This mostly only applies to re-runs by admins as the script running on enrollment should always detect no dialog and download it fresh.

humanendpoint commented 1 year ago

fair enough, just thought I'd chime in :)