grahampugh / erase-install

A script that automates downloading macOS installers, and optionally erasing or upgrading macOS in a single process. Watch the video!
https://grahamrpugh.com/2023/05/14/macaduk-presentation-eraseinstall.html
Apache License 2.0
836 stars 131 forks source link

launcher script for jamf ignoring the required version #387

Closed mrmte closed 1 year ago

mrmte commented 1 year ago

Describe the bug using the launcher script for jamf and im specifying these variables in the policy --current-user --reinstall --version=13.3 --check-power --no-fs --rebootdelay 300 --cleanup-after-use I then on purpose put on the system the 13.2.1 Ventura installer on the system to see what happens. It seems the version is 13.3 is being ignored and its just going ahead and using the 13.2.1 installer on the system instead of deleting it and downloading the proper required version.

To Reproduce run via jamf policy with the launcher script put on the system the 13.2.1 Ventura installer under /Applications folder execute via a self service policy using the launcher script

Expected behavior im expecting the old 13.2.1 installer on the system to delete and download the correct installer

Code/log output \\2023-04-05 04:24:47 [erase-install] Caffeinating this script (pid=2054) 2023-04-05 04:24:47 [check_free_space] OK - 464 GB free/purgeable disk space detected 2023-04-05 04:24:47 [erase-install] Looking for existing installer app or pkg 2023-04-05 04:24:47 [find_existing_installer] Installer found at /Applications/Install macOS Ventura.app. 2023-04-05 04:24:47 [check_installer_is_valid] Checking validity of /Applications/Install macOS Ventura.app. 2023-04-05 04:24:47 [check_installer_is_valid] Mounting /Applications/Install macOS Ventura.app/Contents/SharedSupport/SharedSupport.dmg 2023-04-05 04:24:48 [check_installer_is_valid] Using Build value from com_apple_MobileAsset_MacSoftwareUpdate.xml Volume Shared Support on disk3s2 force-unmounted 2023-04-05 04:24:50 [compare_build_versions] Comparing (1) 21E230 with (2) 22D68 2023-04-05 04:24:50 [check_installer_is_valid] Installer: 22D68 >= System: 21E230 : valid build. 2023-04-05 04:24:50 [erase-install] Running on architecture i386 2023-04-05 04:24:50 [check_power_status] WARNING - No AC power detected 2023-04-05 04:24:50 [get_default_dialog_args] Invoking utility dialog 2023-04-05 04:25:54 [check_power_status] Sending quit message to dialog log (/var/tmp/dialog.pkh) 2023-04-05 04:25:54 [get_default_dialog_args] Invoking utility dialog {

} 2023-04-05 04:25:59 [wait_for_power] ERROR - No AC power detected after waiting for 0s, cannot continue.

2023-04-05 04:25:59 [erase-install] attempting to terminate the 'caffeinate' process - Termination message indicates success

2023-04-05 04:25:59 [finish] sending quit message to dialog (/var/tmp/dialog.pkh) 2023-04-05 04:25:59 [finish] Script exit code: 1\\

Screenshots N/A

Environment (please complete the following information):

Additional context N/A

mrmte commented 1 year ago

closing sorry just read the wiki again and it is working as expected using the found installer.

grahampugh commented 1 year ago

That's not a bug, it is by design. If you want it to update any existing installer on the device, use the --update flag.