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 visible (Hide)

erase-install - 36.0 Latest Release

Published by grahampugh 4 months ago

Updates in 36.0

  • Added Ukrainian localization (#512, thanks to @liubkkkko for this contribution).
  • Added --cloneuser option.

Bugfixes in 36.0

  • Ensured icons directory is created when running as standalone script.

Notice for installing erase-install package on macOS Sequoia

Since the package on this site is not signed, if you download this package from a browser and try to install it from Finder on a Mac running macOS Sequoia, it will fail to install, even if running Ctrl-Click. To solve this, do one of these:

  1. Go to System Settings, Privacy & Security, scroll down, click on "Open Anyway".
  2. Install from the command line, e.g. sudo installer -tgt / -pkg /path/to/erase-install-35.0.pkg
  3. Remove the quarantine bit, e.g. xattr -d com.apple.quarantine /path/to/erase-install-35.0.pkg
erase-install - 35.0

Published by grahampugh 4 months ago

Updates in 35.0

  • Added the --min-battery option which, in conjunction with --check-power allows to set a minimum battery percentage, above which the power check is ignored. For example, --check power --min-battery 30 sets the minimum percentage to 30%. The minimum allowed is 15% (addresses #455, thanks @PhillyPhoto). --check power without --min-battery still requires AC power.
  • Added a 5-minute timeout to the password dialogs to prevent people ignoring it (addresses #501, thanks @PhillyPhoto).
  • Added the --language option to give the ability to override the language of the dialog windows - the default is either the system language or English if there is no translation of the system language available. Now you can set the language to any of the available translations using the short language codes, which are en, de, fr, nl, es, pt, ja. For example, --language de or --language=de will set the language to German regardless of the system language setting.
  • Bumped mist-cli version to 2.1 which fixes a bug downloading macOS Sequoia beta installers.
  • Bumped swiftDialog version to 2.5.0 except for systems running macOS 11 which still get 2.2.1. Note that the installer package includes version 2.5.0. If running on Big Sur, this will be deleted and an internet connection is required to download version 2.2.1.
  • Added the catalog https://swscan.apple.com/content/catalogs/others/index-15seed-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog, which can be used with --beta and --catalog 15 to obtain macOS Sequoia beta installers. Note that this will be replaced with the production macOS 15 catalog once it is published.

Bugfixes in 35.0

  • Fixed the comparison check of installer pkgs with current system when using --pkg mode.
  • Changed lock symbol colour on the password dialog from grey to black as grey seems to have stopped working.
  • Fixed code comment error (#508, thanks @jarrodCoombes).
  • Fixed some function output labels.

Notice for installing erase-install package on macOS Sequoia

Since the package on this site is not signed, if you download this package and try to install it from Finder on a Mac running macOS Sonoma, it will fail to install, even if running Ctrl-Click. To solve this, do either of these:

  1. Install from the command line, e.g. sudo installer -tgt / -pkg /path/to/erase-install-35.0.pkg
  2. Remove the quarantine bit, e.g. xattr -d com.apple.quarantine /path/to/erase-install-35.0.pkg
erase-install - 34.0

Published by grahampugh 6 months ago

Updates in 34.0

  • Added Japanese localization (#496, thanks to @teddi for this contribution).
  • Enforce the required version of mist-cli to prevent reported issues of older versions downloading incompatible macOS installers (#500, thanks @cchsadmin).
  • Use the GitHub API to obtain swiftDialog and mist-cli download URL (#494, thanks @bartreardon).

Bugfixes in 34.0

  • Fix comparison check of this script with latest available version.
erase-install - 33.1

Published by grahampugh 7 months ago

Bugfixes in 33.1

  • Changed swiftDialog download URL which has changed again.
  • Fixed logic for comparing OS versions with the --os and --sameos options, which is broken in 33.0.
erase-install - 33.0

Published by grahampugh 9 months ago

  • Remove searches for cached DMG and sparseimages.
  • Add missing --credentials=XYZ option (previously only --credentials XYZ worked) (thanks @allanp81).
  • Remove quotes from the value obtained from any inputted --parameter="value" option.
  • Bump swiftDialog version to 2.4.0 except for systems running macOS 11 which still get 2.2.1. Note that the installer package includes version 2.4.0. If running on Big Sur, this will be deleted and an internet connection is required to download version 2.2.1.
erase-install - 32.1

Published by grahampugh 9 months ago

  • Add missing --credentials=XYZ option (previously only --credentials XYZ worked) (thanks @allanp81).
  • Remove quotes from the value obtained from any inputted --parameter="value" option.
erase-install - 32.0

Published by grahampugh 11 months ago

  • Include a compatibility check for cached installers, utilising data from the com_apple_MobileAsset_MacSoftwareUpdate.xml file within the Shared Support.dmg. This should prevent installers that were not obtained using erase-install from running if they are not compatible with the system.
  • Add the ability to change the default icon size in dialogs, and to supply an alternative icon for confirmation dialogs (#462, addressed in #463, thanks to @popaprozac).
  • Bump swiftDialog version to 2.3.3 except for systems running macOS 11 which still get 2.2.1. Note that the installer package includes version 2.3.3. If running on Big Sur, this will be deleted and an internet connection is required to download version 2.2.1.
  • Fix swiftDialog URL, which has moved (#469, thanks to @scottborcherdt).
  • Replaced some SF Symbol icons in dialogs for compatibility with macOS 11 (fixes #470, thanks to @BigMacAdmin).
erase-install - 31.0

Published by grahampugh about 1 year ago

  • Bump mist-cli version to 1.15.
  • Bump swiftDialog version to 2.3.2 except for systems running macOS 11 which still get 2.2.1.
  • Added localisation for Brazilian Portuguese (#432, thanks to @hooleahn).
  • --os searches will search for the relevant version name rather than number, to avoid a bug in mist-cli that may result in download an inappropriate installer if the chosen major OS is not available.
  • Use icons in the GitHub repo instead of using the InstallAssistant icon which occasionally doesn't render.
  • Stop trying to use seedutil on 13.4 or newer when using the --ffi option as it doesn't work any more.
  • Moved up the log rotation so that we get all output of the current run, and made it less verbose.
  • Add macOS Sonoma catalog.
erase-install - 31.0

Published by grahampugh about 1 year ago

  • Bump mist-cli version to 1.15.
  • Bump swiftDialog version to 2.3.2 except for systems running macOS 11 which still get 2.2.1.
  • Added localisation for Brazilian Portuguese (#432, thanks to @hooleahn).
  • --os searches will search for the relevant version name rather than number, to avoid a bug in mist-cli that may result in download an inappropriate installer if the chosen major OS is not available.
  • Use icons in the GitHub repo instead of using the InstallAssistant icon which occasionally doesn't render.
  • Stop trying to use seedutil on 13.4 or newer when using the --ffi option as it doesn't work any more.
  • Moved up the log rotation so that we get all output of the current run, and made it less verbose.
  • Add macOS Sonoma catalog.
erase-install - 30.2

Published by grahampugh about 1 year ago

  • Emergency release to fix the listing of 13.6 RC in the regular lists. This is caused due to the mist-cli default catalogs including the seed catalogs. Now the production catalog is specified unless using the --beta option.
erase-install - 30.1

Published by grahampugh about 1 year ago

  • (Hopefully temporary) fix for a bug in mist-cli where it isn't setting the permissions of the Install application properly.
  • Remove ANSI formatting from mist-cli output when listing installers.
  • Output stderr from swiftDialog to dev/null to avoid occasional Xfont error warnings in logs
  • Minor fixes.
erase-install - 30.0

Published by grahampugh over 1 year ago

  • Converted to zsh.
  • Bumped the compatible version of mist-cli to v1.14.
  • Bumped the compatible version of swiftDialog to 2.2.1.4591.
  • Can now run erase-install.sh --list safely as the current user (without sudo); logs and files are written to a temporary location.
  • A notification is shown if running an older version of erase-install than the latest available (on macOS 13 or newer).
  • Allows mist to use a caching server (addresses #406). Add the following option:
    • --caching-server https://YOUR_URL_HERE
  • It is now possible to supply credentials in base64 format to avoid the prompt for credentials on Apple Silicon computers.
    • NOTE THIS IS VERY INSECURE! ONLY USE IN A SAFE ENVIRONMENT!!!
    • Use the supplied script set-credentials.sh to generate the base64-encoded credentials.
    • Alternatively use the following shell command: printf "%s:%s" "<USERNAME>" "<PASSWORD>" | iconv -t ISO-8859-1 | base64 -i -
    • Add the following option: --credentials ENCODEDCREDENTIALS
    • Also add this option: --very-insecure-mode (this is required in addition to the --credentials option!).
  • If running the script on macOS 11, it now checks ot see if the swiftDialog version is too new (addresses #392).
  • --update no longer ignores --sameos (fixes #407).
  • erase-install-launcher.sh is also converted to zsh.
  • erase-install-launcher.sh should now respect parameters that have spaces in them, such as commands called by the --postinstall-command option.
  • Fixed version comparisons where there is a point release (fixes #410).
  • Pre- and post-install commands are now run in --test-run mode.
  • Now exits out when some incompatible arguments are provided at the same time.
erase-install - 29.2

Published by grahampugh over 1 year ago

  • Fix downloads from mist only selecting compatible builds.
  • Version bump to use mist-cli v1.12, which includes a less verbose output for the download logs (one register per percentage download instead of one register per second).
erase-install - 29.1

Published by grahampugh over 1 year ago

  • --os can now be used along with --fetch-full-installer.
  • Remove audible sound when 1 hour timeout is reached.
  • Log output from mist is now somewhat reduced due to the use of the no-ansi mode.
  • Add --quiet option to prevent large output from mist. Note that with this mode enabled, there is no download progress bar, since the output is required to read the download progress.
  • Log files are now rotated up to 9 times (#369, thanks to @aschwanb).

Bugfixes

  • Do not list deferred updates when using along --list with --fetch-full-installer (addresses #347).
  • Fix issue with swiftDialog windows not showing up. This was due to a change in behaviour in swiftDialog version 2.1 enforcing running the app as the local user rather than root, which meant that the log file could not be overwritten. The log file is now deleted after use and each run creates a random logfile path (addresses #352, #366 and #368).
  • Reintroduce --skip-validation functionality.
  • Fix issue with using --version along with --fetch-full-installer.
  • Fix a problem where mist did not correctly output (addresses #357).
erase-install - 29.0

Published by grahampugh over 1 year ago

  • New --check-fmm option to prompt the user to disable Find My Mac if it is enabled (in --erase mode only). The default wait limit is 5 minutes before failing. This can be altered using a new --fmm-wait-limit option.

Bugfixes

  • Fixed Minimum Drive Space dialog not showing (fixes #353).
  • Fixed incorrect full screen "reboot delay" screen (fixes #348). If --fs mode is used, the fullscreen preparation window now remains until the end of the reboot delay period.
  • Fixed some incorrect/inconsistent window and icon sizes.
  • Fixed some missing window titles.
  • Fixed missing icon on macOS<13 (fixes #351).
erase-install - 28.1

Published by grahampugh over 1 year ago

  • --cache-downloads option. In 28.0, mist cached downloads into /private/tmp/com.ninxsoft.mist. This is now optional.
  • New experimental --set-securebootlevel option (in --erase mode only) uses the command bputil -f -u $current_user -p $account_password to ensure that the OS is reset to a high secure boot level after reinstallation (thanks to @mvught).
  • New experimental --clear-firmware option (in --erase mode only) uses the command nvram -c to ensure that the OS is reset to a high secure boot level after reinstallation (thanks to @mvught).
  • erase-install now reports a non-zero exit code (143 to be exact) when it is being abnormally terminated (e.g. by pressing CTRL+C or getting terminated by SIGTERM). Previously it would return the exit code of the last command being executed at time of termination, which could be non-zero or zero depending on the specific circumstances, which then could have been reported as successful execution in a Jamf policy. This change will make it easier to discover such errors. The exit code of the last executed command will be logged in addition to returning 143 to facilitate debugging (#318, thanks @cvgs).

Bugfixes:

  • mist result is now correctly interpreted when checking for a newer version.
  • The --update option now triggers an invalid installer to be overwritten.
  • Progress is now once again shown during the preparation phase, and the progress bar properly shows incremental progress.
erase-install - 28.0

Published by grahampugh over 1 year ago

  • Calls to installinstallmacos.py have been replaced with calls to mist. Minimum OS requirement for this is macOS 10.15.
  • Dialogues are now all presented using swiftDialog. Minimum OS requirement for this is macOS 11.
  • The minimum compatible OS for swiftDialog is macOS Big Sur 11. If you need to upgrade a Mac on an older version of macOS, use Version 27.x of erase-install.
  • Downloads are now only available as a pkg or an app. Downlaoding of a sparseimage has been discontinued, though the script will continue to search for them to allow for upgrade from earlier versions of erase-install without having to re-download the installer.
  • The log has moved to /Library/Management/erase-install/log/erase-install.log
  • New --silent mode. The script can now be run without any dialogues. On Apple Silicon, this requires the use of the keychain method to provide credentials. Minimum OS requirement for this is macOS 10.15.
  • Add Spanish dialogs.
  • For testing purposes, a username and password may be placed in a custom keychain. Username is optional as the current user can be used. To create the keychain and add the keys, run the following commands:
    • security create-keychain -P NAME_OF_KEYCHAIN - this will prompt you to create a password for the keychain. The keychain will be stored in ~/Library/Keychains. NAME_OF_KEYCHAIN must match the value you give to the --kc key. The password you create must match the value you give to the --kc-pass key.
    • security add-generic-password -s NAME_OF_SERVICE -a NAME_OF_USER -w PASSWORD NAME_OF_KEYCHAIN - NAME_OF_SERVICE must match the value you provide to the --kc-service key. NAME_OF_USER and PASSWORD must be the valid credentials of an account on the computer with Volume Ownership.
erase-install - 27.3

Published by grahampugh over 1 year ago

  • (change to installinstallmacos.py): version comparisons are now done with the python module packaging.version.LegacyVersion, as parse_version proved unreliable.
erase-install - 27.2

Published by grahampugh almost 2 years ago

  • Better handling of replacing broken sparseimage files. If--update, or --replace-invalid are used and the version cannot be obtained from the sparseimage, the installer should be downloaded again. This also fixes --overwrite which was not working where an existing sparseimage was present.
  • Add --no-timeout option which extends the timeout period to 24h.
erase-install - 27.1

Published by grahampugh almost 2 years ago

  • Add catalog for macOS Ventura to installinstallmacos.py, update checksum in erase-install.sh.