diff --git a/CHANGELOG.md b/CHANGELOG.md index 18f199b..b688757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,37 @@ # CHANGELOG -## Version History +## [Untagged] -## 0.15.1 +No date + +- If there are any changes since the last tag, click [here][untagged] to see the changes. + +## [0.15.2] + +14.07.2020 + +- Fixed some failed logic around the check for whether there is already an installer in the `/Applications` folder which was erroneously also looking in other locations. + +## [0.15.1] 23.06.2020 - Parameters can now be supplied as `--argument value` as an alternative to `--argument=value` to provide more consistency with the included tools (`installinstallmacos.py` and `softwareupdate`). -## 0.15.0 +## [0.15.0] 09.06.2020 - Adds `--allowremoval` option to the `startosinstall` command by default. This is an undocumented flag which is required under certain circumstances where there are backup files on the system disk. -## 0.14.0 +## [0.14.0] 06.05.2020 - Adds `--replace_invalid` option for the option to overwrite a cached installer if it is not valid for use with `--erase` or `--reinstall`. - Adds `--update` option for the option to overwrite a cached installer if a newer installer is available. -## 0.13.0 +## [0.13.0] 04.05.2020 @@ -30,13 +40,13 @@ - Fix for missing heading in the full screen display of the `--reinstall` option. - Added a test script `tests/test-erase-install.sh` for testing out functionality. -## 0.12.1 +## [0.12.1] 14.04.2020 - Use `--forcequitapps` when _using_ the macOS Catalina installer, rather than just when _running_ on a macOS Catalina client (issue #25). -## 0.12.0 +## [0.12.0] 13.02.2020 @@ -44,25 +54,25 @@ - Fixed a problem preveting `--move` from working when overwriting a valid installer. - Other small bugfixes. -## 0.11.1 +## [0.11.1] 03.02.2020 - Restricted the add forcequitapps install_args option to macOS 10.15 or greater, as this is not functional with older versions (#35). Thanks to '@ahousseini' for the contribution. -## 0.11.0 +## [0.11.0] 22.01.2020 - Added the `--sameos` option, so you can have a single command which will always try to reinstall whatever macOS (major) version is currently installed on the host. -## 0.10.1 +## [0.10.1] 11.12.2019 - Removed check that a user is logged in before proceeding with startosinstall - apparently not necessary after all, and caused at least one user's workflow to break (#33). -## 0.10.0 +## [0.10.0] 27.11.2019 @@ -75,32 +85,32 @@ Thanks to '@ahousseini' for various contributions to this release -## 0.9.1 +## [0.9.1] 15.11.2019 - Move a comment that states that --fetch-full-installer is available to the correct place (#31) -## 0.9.0 +## [0.9.0] 07.10.2019 - Added support for `softwareupdate --fetch-full-installer` and `seedutil` for clients running macOS 10.15 or greater. -## 0.8.0 +## [0.8.0] 27.09.2019 - Fixed caffeinate (forgot to make it a background process) - Added 'Confirm' option for erasing. Thanks to '@ryan-alectrona' for the contribution. -## 0.7.1 +## [0.7.1] 26.09.2019 - Added caffeinate to the script to prevent the computer going to sleep during long download phases etc. -## 0.7.0 +## [0.7.0] 12.07.2019 @@ -108,13 +118,13 @@ Thanks to '@ahousseini' for various contributions to this release - Changed behaviour of `--os`, `--version` and auto (i.e. no flag) options to get the latest rather than earliest valid build. - Removed `install-macos.sh` script. Use `erase-install.sh` with `--reinstall` option instead. -## 0.6.0 +## [0.6.0] 19.06.2019 - Added `--reinstall` option, which obsoletes the `install-macos.sh` script. -## 0.5.0 +## [0.5.0] 16.04.2019 @@ -122,7 +132,7 @@ Thanks to '@ahousseini' for various contributions to this release Thanks to '@Avartharian' for contributions - Added `--catalogurl` and `--seedprogram` options -## 0.4.0 +## [0.4.0] 02.04.2019 @@ -131,13 +141,13 @@ Thanks to '@ahousseini' for various contributions to this release - Added `--os`, `--path`, `--extras`, `--list` options. Thanks to '@mark lamont' for contributions -## 0.3.2 +## [0.3.2] 13.12.2018 - Bug fix for `--build` option, and for exiting gracefully when nothing is downloaded. -## 0.3.1 +## [0.3.1] 21.09.2018 @@ -145,13 +155,13 @@ Thanks to '@ahousseini' for various contributions to this release - Fixed the `--overwrite` flag. - Added ability to specify a build in the parameters, and we now clear out the cached content. -## 0.3.0 +## [0.3.0] 03.09.2018 - Additional and amended options for selecting non-standard builds. -## 0.2.0 +## [0.2.0] 09.07.2018 @@ -162,3 +172,28 @@ Thanks to '@ahousseini' for various contributions to this release 29.03.2018 - Initial version. Expects a manual choice of installer from `installinstallmacos.py`. + +[untagged]: https://github.com/grahampugh/erase-install/compare/v0.15.2...HEAD +[0.15.2]: https://github.com/grahampugh/erase-install/compare/v0.15.1...v0.15.2 +[0.15.1]: https://github.com/grahampugh/erase-install/compare/v0.15.0...v0.15.1 +[0.15.0]: https://github.com/grahampugh/erase-install/compare/v0.14.0...v0.15.0 +[0.14.0]: https://github.com/grahampugh/erase-install/compare/v0.13.0...v0.14.0 +[0.13.0]: https://github.com/grahampugh/erase-install/compare/v0.12.1...v0.13.0 +[0.12.1]: https://github.com/grahampugh/erase-install/compare/v0.12.0...v0.12.1 +[0.12.0]: https://github.com/grahampugh/erase-install/compare/v0.11.1...v0.12.0 +[0.11.1]: https://github.com/grahampugh/erase-install/compare/v0.11.0...v0.11.1 +[0.11.0]: https://github.com/grahampugh/erase-install/compare/v0.10.1...v0.11.0 +[0.10.1]: https://github.com/grahampugh/erase-install/compare/v0.10.0...v0.10.1 +[0.10.0]: https://github.com/grahampugh/erase-install/compare/v0.9.1...v0.10.0 +[0.9.1]: https://github.com/grahampugh/erase-install/compare/v0.9.0...v0.9.1 +[0.9.0]: https://github.com/grahampugh/erase-install/compare/v0.8.0...v0.9.0 +[0.8.0]: https://github.com/grahampugh/erase-install/compare/v0.7.1...v0.8.0 +[0.7.1]: https://github.com/grahampugh/erase-install/compare/v0.7.0...v0.7.1 +[0.7.0]: https://github.com/grahampugh/erase-install/compare/v0.6.0...v0.7.0 +[0.6.0]: https://github.com/grahampugh/erase-install/compare/v0.5.0...v0.6.0 +[0.5.0]: https://github.com/grahampugh/erase-install/compare/v0.4.0...v0.5.0 +[0.4.0]: https://github.com/grahampugh/erase-install/compare/v0.3.2...v0.4.0 +[0.3.2]: https://github.com/grahampugh/erase-install/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/grahampugh/erase-install/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/grahampugh/erase-install/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/grahampugh/erase-install/compare/v0.1.0...v0.2.0 diff --git a/erase-install.sh b/erase-install.sh index 26250f1..278f59e 100755 --- a/erase-install.sh +++ b/erase-install.sh @@ -184,33 +184,28 @@ check_installer_is_valid() { if [[ $installer_os_version -lt $installed_os_version ]]; then echo " [check_installer_is_valid] $installer_version < $installed_version so not valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" invalid_installer_found="yes" elif [[ $installer_os_version -eq $installed_os_version ]]; then if [[ $installer_minor_version -lt $installed_minor_version ]]; then echo " [check_installer_is_valid] $installer_version < $installed_version so not valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" invalid_installer_found="yes" else echo " [check_installer_is_valid] $installer_version >= $installed_version so valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" fi else echo " [check_installer_is_valid] $installer_version > $installed_version so valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" fi } find_existing_installer() { - installer_app=$( find "$installer_directory/"*macOS*.app -maxdepth 1 -type d -print -quit 2>/dev/null ) # Search for an existing download + # First let's see if this script has been run before and left an installer macOSDMG=$( find $workdir/*.dmg -maxdepth 1 -type f -print -quit 2>/dev/null ) macOSSparseImage=$( find $workdir/*.sparseimage -maxdepth 1 -type f -print -quit 2>/dev/null ) - - # First let's see if this script has been run before and left an installer + installer_app=$( find "$installer_directory/"*macOS*.app -maxdepth 1 -type d -print -quit 2>/dev/null ) if [[ -f "$macOSDMG" ]]; then echo " [find_existing_installer] Installer image found at $macOSDMG." hdiutil attach "$macOSDMG" @@ -223,6 +218,7 @@ find_existing_installer() { check_installer_is_valid elif [[ -d "$installer_app" ]]; then echo " [find_existing_installer] Installer found at $installer_app." + app_is_in_applications_folder="yes" check_installer_is_valid else echo " [find_existing_installer] No valid installer found." diff --git a/tests/test-erase-install.sh b/tests/test-erase-install.sh index 6d2c7cc..9ba8b22 100755 --- a/tests/test-erase-install.sh +++ b/tests/test-erase-install.sh @@ -184,33 +184,28 @@ check_installer_is_valid() { if [[ $installer_os_version -lt $installed_os_version ]]; then echo " [check_installer_is_valid] $installer_version < $installed_version so not valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" invalid_installer_found="yes" elif [[ $installer_os_version -eq $installed_os_version ]]; then if [[ $installer_minor_version -lt $installed_minor_version ]]; then echo " [check_installer_is_valid] $installer_version < $installed_version so not valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" invalid_installer_found="yes" else echo " [check_installer_is_valid] $installer_version >= $installed_version so valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" fi else echo " [check_installer_is_valid] $installer_version > $installed_version so valid." installmacOSApp="$installer_app" - app_is_in_applications_folder="yes" fi } find_existing_installer() { - installer_app=$( find "$installer_directory/"*macOS*.app -maxdepth 1 -type d -print -quit 2>/dev/null ) # Search for an existing download + # First let's see if this script has been run before and left an installer macOSDMG=$( find $workdir/*.dmg -maxdepth 1 -type f -print -quit 2>/dev/null ) macOSSparseImage=$( find $workdir/*.sparseimage -maxdepth 1 -type f -print -quit 2>/dev/null ) - - # First let's see if this script has been run before and left an installer + installer_app=$( find "$installer_directory/"*macOS*.app -maxdepth 1 -type d -print -quit 2>/dev/null ) if [[ -f "$macOSDMG" ]]; then echo " [find_existing_installer] Installer image found at $macOSDMG." hdiutil attach "$macOSDMG" @@ -223,6 +218,7 @@ find_existing_installer() { check_installer_is_valid elif [[ -d "$installer_app" ]]; then echo " [find_existing_installer] Installer found at $installer_app." + app_is_in_applications_folder="yes" check_installer_is_valid else echo " [find_existing_installer] No valid installer found." @@ -278,6 +274,7 @@ run_fetch_full_installer() { if [[ $seedprogram ]]; then echo " [run_fetch_full_installer] Non-standard seedprogram selected" /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll $seedprogram + /usr/sbin/softwareupdate -l -a fi softwareupdate_args='' @@ -482,6 +479,38 @@ do ;; -f|--fetch-full-installer) ffi="yes" ;; + --seedprogram) + shift + seedprogram="$1" + ;; + --catalogurl) + shift + catalogurl="$1" + ;; + --path) + shift + installer_directory="$1" + ;; + --extras) + shift + extras_directory="$1" + ;; + --os) + shift + prechosen_os="$1" + ;; + --version) + shift + prechosen_version="$1" + ;; + --build) + shift + prechosen_build="$1" + ;; + --workdir) + shift + workdir="$1" + ;; --seedprogram*) seedprogram=$(echo $1 | sed -e 's|^[^=]*=||g') ;; @@ -697,7 +726,7 @@ fi # run it! # "$installmacOSApp/Contents/Resources/startosinstall" "${install_args[@]}" --agreetolicense --nointeraction "${install_package_list[@]}" -# kill Self Service if running +# # kill Self Service if running # kill_process "Self Service" # kill Jamf FUD if startosinstall ends before a reboot kill_process "jamfHelper"