erase-install

A script that automates downloading macOS installers, and optionally erasing or upgrading macOS in a single process. Watch the video!

APACHE-2.0 License

Stars
836
Committers
24

Bot releases are hidden (Show)

erase-install - v27.0

Published by grahampugh about 2 years ago

  • Allows for logs to be reported back to Jamf Pro by changing the method startosinstall is launched. This requires rebootdelay to be set, which allows uploading the script result to Jamf Pro before startosinstall force-quits our script and reboots the machine (thanks to @cvgs).
  • Adds launcher script erase-install-launcher.sh which can be used to start the pkg-delivered version of erase-install from the Scripts section of Jamf Pro (it also supports more than 8 arguments for erase-install because you can add multiple arguments in one Jamf Parameter field) (thanks to @cvgs).
  • Adds some fallbacks for the --fetch-full-installer option.
  • If no build ID is found in the existing installer, we set it as invalid instead of exiting the script (addresses #271, thanks to @sphen13).
  • Fix the fallback free disk space calculation (df was returning disk size in kb and not gb) (#274 - thanks to @sphen13).
  • --update option now uses new logic in installinstallmacos.py to restrict searches to a certain OS or version (addresses #287).
  • Improved function descriptions in the script.
  • Changed the Makefile to download the correct version of installinstallmacos.py during the make process.
  • Improved checksum checks for installinstallmacos.py - if an incorrect checksum is found, the correct version is downloaded rather than the script failing (unless --no-curl option has been added).
  • Add titles to username and password dialog boxes (#289, thanks to @cvgs)
  • Now correctly deletes a sparseimage from the cache when --move is used and the sparseimage is downloaded (#297, thanks to @andyincali)
  • Now correctly fails if an invalid installer is found and --replace-invalid, --update, --overwrite or --skip-validation are not set (addresses #298).
erase-install - 26.2

Published by grahampugh about 2 years ago

  • Allows rebootdelay for 10.15 (thanks to @cvgs).
  • New --newvolumename key which will set the volume name after an eraseinstall workflow (thanks to @bmacphail).
  • Now correctly validates whether a selected build value matches the cached installer.
erase-install - 26.1

Published by grahampugh over 2 years ago

  • Universal python build packages.
  • Use pkg_resources instead of distutils where available (allows for removal if distutils in python 3.12 - addresses grahampugh/macadmin-scripts/issues/47).
  • Improves the --fetch-full-installer option by looking for the latest version if not specified, and checking that a pre-chosen version is in the list. --list in conjunction with --ffi also now uses --list-full-installers instead of reverting to installinstallmacos.py.
  • Allows the usage of spaces in --workdir and --path (thanks to @cvgs).
  • Added --max-password-attempts=NN option, which can also be set to infinite to prevent canceling the password dialog (addresses #216, thanks to @cvgs).
  • Changes dialogs so that the Cancel button is on the left, and default button is on the right (thanks to @cvgs).
  • Script now uses sysctl to check for Apple Silicon (addresses #225, thanks to @cvgs).
  • Some minor changes to the German translation (thanks to @cvgs).
  • Adds an additional check for --min-drive-space right before start of the installation (should address #242, thanks to @cvgs).
  • Adds -nobrowse to all instances of hdiutil to prevent mounted images appearing on the desktop (thanks to @cvgs).
erase-install - 26.0

Published by grahampugh over 2 years ago

  • Adds --catalog to allow an easier way to select which software update catalog to use, rather than the defaults set in installinstallmacos.py. Example: --catalog 10.15 will use the catalog for Darwin version 19, --catalog 11 will use Darwin version 20. This is to address omissions in the catalogs for older OSes (somewhat addresses #169, #160).
  • Allow for more lenient checks for Volume Ownership against the entered username (#177, thanks to @cvgs)
  • Adds --rebootdelay option (Big Sur or later) (#193).
  • DEPNotify counts down the rebootdelay time.
  • Adds --fs option which makes all the DEPNotify windows full screen (download, confirm, preparation).
  • User can dismiss the DEPNotify download and preparation windows if --rebootdelay is set to at least 10 seconds.
  • Multiple --preinstall-command arguments can now be supplied. These run immediately before startosinstall is run.
  • Multiple --postinstall-command arguments can now be supplied. These run after startosinstall has finished.
  • Checksums of installinstallmacos.py are now pinned to a tag of the macadmins-scripts repo so that updates to the script don't break a particular version of erase-install.sh from working.
  • Add a message about process Terminations, which some people were mistakenly believing to be errors.
  • Fixed the actual killing of jamfHelper and caffeinate.
  • osascript dialog windows now run as the user (addresses #198, thanks to @anewhouse).
  • Fixed an issue concerning the catalog for macOS High Sierra 10.13 which has an item without a version string listed, which was causing installinstallmacos.py to error out (addresses #169).
erase-install - 25.0

Published by grahampugh over 2 years ago

  • Determines free space better by checking free and purgeable space (partial fix for #152; thanks to Pico in MacAdmins Slack).
  • Uses exit traps to clean up after all abnormal exits (fixes #140, #141; thanks to @ryangball).
  • Adds -nobrowse to hdiutil to prevent mounted images appearing on the desktop (thanks to @ryangball).
  • Allows 5 password attempts (fixes #159).
  • Adds dialog to show how much time is left in the power check (#144; thanks to @dan-snelson).
  • Some dialog changes, to replace the word "reinstall", which some people have found confusing, with "install" (addresses #149).
  • Changed log location to the $workdir so that it persists after an upgrade, and also so it is wiped if using the --cleanup-after-use option (fixes #161).
  • Remove check for membership of staff group for Apple Silicon Macs, since Volume Ownership is already checked it's not necessary, and was preventing non-admin AD users from proceeding (fixes #166).
  • Re-order some initial statements to ensure that the chosen $workdir has been created before DEPNotify is downloaded and the log file is determined (fixes #165).
  • Some minor changes to the Dutch translation (addresses #164, thanks @Alitekawi).
erase-install - 0.22.0

Published by grahampugh about 3 years ago

  • Add preparation progress information to the DEPNotify bar (#122, thanks @andredb90).
  • SIP check only checks for partial SIP enablement (#110, thanks @anverhousseini).
  • New --preinstall-command option to run a command prior to the beginning of the startosinstall run (thanks Fredrik Virding for the idea).
  • Fix build version comparisons (this affected macOS 11.6) (#124, thanks @boberito)
  • Allow use of --confirm option for reinstallation (#123)
  • Improve version comparisons in check_newer_available function (should improve --update reliability)
  • Fix erase or reinstall from a InstallAssistant package if it has not already been extracted with the --move option (#111).
erase-install - 0.21.0

Published by grahampugh about 3 years ago

  • Add French translation (thanks @Darkomen78).
  • Fix version for which --allowremoval is set when doing a reinstall (thanks @anverhousseini).
  • Kill DEPNotify in places where jamfHelper is killed (#106, thanks @julienvs).
  • Added '$script_name' variable - if you want to change the script name, the echo statements will reflect this value rather than 'erase-install'.
  • Added --clear-cache-only option, which works in conjunction with --overwrite or --update to perform the removal of cached installers but then quit rather than carry on with any further workflow (#105).
  • Added a more verbose message that --test-run has been implemented (#93).
erase-install - 0.20.1

Published by grahampugh over 3 years ago

  • The Cancel button is now default in the Confirm dialog when not using jamfHelper or DEPNotify. Note that DEPNotify only offers one button so we cannot provide a straightforward Cancel button.
  • The contents of the README.md have been replaced with a wiki.
erase-install - 0.20.0

Published by grahampugh over 3 years ago

  • --depnotify option. Uses DEPNotify instead of jamfHelper, if it is installed.
  • --no-jamfhelper option. Ignores the jamfHelper installation. Useful for testing the osascript dialogs.
erase-install - 0.19.2

Published by grahampugh over 3 years ago

  • Another fix to the check that --fetch-full-installer can be used.
  • Edited Dutch localizations (thanks again to Thijs Vught)
erase-install - 0.19.1

Published by grahampugh over 3 years ago

  • Fix for check that --fetch-full-installer can be used.
  • Dutch localizations (thanks to Thijs Vught)
erase-install - 0.19.0

Published by grahampugh over 3 years ago

  • Output from erase-install.sh is now written to /var/log/erase-install.sh in addition to stdout.
  • Checks that the supplied user is an admin when performing --eraseinstall on M1, which appears to be a requirement (not for startosinstall without --eraseinstall). If it is not, it promotes the user to admin.
  • Checks that the supplied user is a Volume Owner on M1 (rather than merely having a Secure Token)
  • Runs diskutil apfs updatePreboot / prior to startosinstall to (experimentally) address a problem seen by some user accounts that were promoted using Privileges.app.
  • Adds localization for osascript dialogs
erase-install - 0.18.0

Published by grahampugh over 3 years ago

  • Add --check-power option. Set this to check for AC power. Also --power-wait-limit sets a time limit to wait for power (default is 60 seconds).
  • Merge in upstream changes to installinstallmacos.py. This improves download resumption.
erase-install - 0.17.4

Published by grahampugh over 3 years ago

  • Default minimum drive space now set to 45GB, but can now be overridden with the --min-drive-space NN option.
  • Fixed the --confirm option (#68).
  • Improved the --help output with more recent keys.
erase-install - 0.17.3

Published by grahampugh over 3 years ago

  • For Catalina and earlier, do OS validation only as far as the minor release. This allows for the mismatch between advertised build and DTSDKBuild (fixes Issue #53).
  • Fix for when VolumeName is not Macintosh HD or any two-word name (fixes Issue #58).
  • Added exit 1 code if script exists due to not successfully downloading an installer (fixes Issue #52).
  • Increase munimum disk space required to 30GB, which aligns better Apple's recommendation for macOS Big Sur (see HT211238).
erase-install - 0.17.2

Published by grahampugh almost 4 years ago

  • Testing moving caffeinate to the end of the script but using a second --pidtosignal argument in startosinstall to kill caffeinate. It is not documented that --pidtosignal can be called multiple times, so this is experimental, but seems necessary on Big Sur as the "preparing upgrade" step is much longer than with previous OSs.
erase-install - 0.17.1

Published by grahampugh almost 4 years ago

  • Added --test-run option which runs everything except the startosinstall command. Useful for testing new workflows (test-erase-install.sh is therefore deleted)
  • Moved the prompt for user details for Apple Silicon Macs up the script so users don't get prompted later.
  • No longer checks to see if the user is an administrator as this is apparently not a criterion - only Secure Token matters.
  • Bug fix: remove alignment flags in the jamfHelper commands to solve a product issue with jamfHelper on Apple Silicon Macs.
erase-install - 0.17.0

Published by grahampugh almost 4 years ago

  • New --current-user option to use the current logged in user for startosinstall authorisation on M1/DTK Macs.
  • New --user option to specify a user for startosinstall authorisation on M1/DTK Macs.
  • Now checks whether the specified user is an administrator.
  • Now checks whether the specified user has a Secure Token.
  • Now checks if the given password is correct.
  • New --no-fs option for replacing the full-screen display with a utility window (for testing purposes).
  • Now quits caffeinate before beginning startosinstall.
  • Now correctly identifies Apple Silicon Mac Device IDs for compatibility checks.
  • Now gets the installer version from /Volumes/Shared Support/com_apple_MobileAsset_MacSoftwareUpdate/com_apple_MobileAsset_MacSoftwareUpdate.xml as this is a more reliable build number than the one in Info.plist.
  • Now makes more reliable version comparisons using BuildVersion by splitting the check into more sections (AABCCDDE instead of AABCCCCD).
  • Script version number is now displayed when running the script. I just have to remember to update it...
  • added --list-full-installers option which runs softwareupdate --list-full-installers according to the seedprogram selected.
  • test-erase-install.sh script is now included in the installer package.
erase-install - 0.16.1

Published by grahampugh almost 4 years ago

  • Bug fix: --auto was being incorrectly assigned when using --os, --build etc.
erase-install - 0.16.0

Published by grahampugh almost 4 years ago

  • Added the --pkg option allowing the download of an InstallAssistant package, utilising an update alresdy made to the installinstallmacos.py fork. For Big Sur or greater only. This will probably need some more error checking.
  • Added the --keep-pkg option which prevents the deletion of the package if the --move option is used to extract the package to /Applications. By default, the package will be deleted on successful extraction.
  • Added the --force-curl and --no-curl options, allowing the control of whether to download installinstallmacos.py. This is in anticipation of a Makefile and package release of erase-install.sh.
  • Added Makefile. This allows you to build a self-contained package containing erase-install.sh and installinstallmacos.py so that curl is not used during the run of erase-install.sh to update installinstallmacos.py. This requires munkipkg and expects to find the grahampugh fork of installinstallmacos.py in ../macadmins-scripts. Make sure you don't bundle in Greg Neagle's version of installinstallmacos.py inadvertently (or this script will fail). A package will be provided on GitHub for this and subsequent versions. Note that erase-install.sh is installed into /Library/Management/erase-install. I deliberately have not put erase-install.sh into the PATH.
  • Added the --user and --stdinpass arguments when running on a Silicon Mac. Silicon Macs require an admin user and password to run startosinstall.
  • Now treats 10.x or 11+ as major versions for OS comparisons.
  • Fix in installinstallmacos.py for os comparisons failing where no Version is provided from the catalog.