Skip to content

Instantly share code, notes, and snippets.

@niw
Last active October 23, 2024 03:20
Show Gist options
  • Save niw/1bac63d716f71555fa6bbda43ddfc504 to your computer and use it in GitHub Desktop.
Save niw/1bac63d716f71555fa6bbda43ddfc504 to your computer and use it in GitHub Desktop.

Revisions

  1. niw revised this gist Jun 10, 2023. 1 changed file with 16 additions and 2 deletions.
    18 changes: 16 additions & 2 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ while getopts ":d:h" opts; do
    ;;
    h)
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, bigsur_beta, monterey, or monterey_beta"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, bigsur_beta, monterey, monterey_beta, ventura, or ventura_beta"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
    @@ -80,13 +80,27 @@ case $NAME in
    DOWNLOAD_ASSETS=1
    ;;
    monterey_beta)
    INSTALL_APP_PATH="/Applications/Install macOS 12 Beta.app"
    INSTALL_APP_PATH="/Applications/Install macOS Monterey Beta.app"
    MAC_APP_STORE_ID="id1556159220"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS12Seed1"
    DISK_IMAGE_SIZE="14G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    ventura)
    INSTALL_APP_PATH="/Applications/Install macOS Ventura.app"
    MAC_APP_STORE_ID="id1638787999"
    DISK_IMAGE_SIZE="14G"
    DOWNLOAD_ASSETS=1
    ;;
    ventura_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Ventura Beta.app"
    MAC_APP_STORE_ID="id1616785793"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS13Seed1"
    DISK_IMAGE_SIZE="14G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    *)
    echo "Unknown name '$NAME'. See usage by give -h." >&2
    exit 1
  2. niw revised this gist Mar 13, 2022. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ while getopts ":d:h" opts; do
    ;;
    h)
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, bigsur_beta, or monterey_beta"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, bigsur_beta, monterey, or monterey_beta"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
    @@ -73,6 +73,12 @@ case $NAME in
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    monterey)
    INSTALL_APP_PATH="/Applications/Install macOS Monterey.app"
    MAC_APP_STORE_ID="id1576738294"
    DISK_IMAGE_SIZE="14G"
    DOWNLOAD_ASSETS=1
    ;;
    monterey_beta)
    INSTALL_APP_PATH="/Applications/Install macOS 12 Beta.app"
    MAC_APP_STORE_ID="id1556159220"
  3. niw revised this gist Jun 12, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -77,7 +77,7 @@ case $NAME in
    INSTALL_APP_PATH="/Applications/Install macOS 12 Beta.app"
    MAC_APP_STORE_ID="id1556159220"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS12Seed1"
    DISK_IMAGE_SIZE="10G"
    DISK_IMAGE_SIZE="14G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
  4. niw revised this gist Jun 12, 2021. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -74,7 +74,7 @@ case $NAME in
    DOWNLOAD_ASSETS=1
    ;;
    monterey_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Big Sur Beta.app"
    INSTALL_APP_PATH="/Applications/Install macOS 12 Beta.app"
    MAC_APP_STORE_ID="id1556159220"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS12Seed1"
    DISK_IMAGE_SIZE="10G"
    @@ -125,13 +125,16 @@ else
    /usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist
    fi

    if [[ ! -z $MAC_APP_STORE_ID ]]; then
    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"
    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    elif [[ ! -z $BUNDLE_ID ]]; then
    if [[ ! -z $BUNDLE_ID ]]; then
    # Open Preferences to download macOS installer app.
    /usr/bin/open "x-apple.systempreferences:com.apple.preferences.softwareupdate?client=bau&installMajorOSBundle=$BUNDLE_ID"
    echo "Click Download to download installer app, then run this script again to create an install disk image."
    elif [[ ! -z $MAC_APP_STORE_ID ]]; then
    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"
    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    else
    echo "Mising both Bundle ID and Mac App Store ID." >&2
    exit 1
    fi
    fi
  5. niw revised this gist Jun 12, 2021. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ while getopts ":d:h" opts; do
    ;;
    h)
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, or bigsur_beta"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, bigsur_beta, or monterey_beta"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
    @@ -73,6 +73,14 @@ case $NAME in
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    monterey_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Big Sur Beta.app"
    MAC_APP_STORE_ID="id1556159220"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS12Seed1"
    DISK_IMAGE_SIZE="10G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    *)
    echo "Unknown name '$NAME'. See usage by give -h." >&2
    exit 1
  6. niw revised this gist Mar 2, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ while getopts ":d:h" opts; do
    ;;
    h)
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, or bigsur_beta"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, bigsur, or bigsur_beta"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
  7. niw revised this gist Nov 22, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -60,6 +60,12 @@ case $NAME in
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    bigsur)
    INSTALL_APP_PATH="/Applications/Install macOS Big Sur.app"
    MAC_APP_STORE_ID="id1526878132"
    DISK_IMAGE_SIZE="10G"
    DOWNLOAD_ASSETS=1
    ;;
    bigsur_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Big Sur Beta.app"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS1016Seed1"
  8. niw revised this gist Aug 15, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@ case $NAME in
    DOWNLOAD_ASSETS=1
    ;;
    bigsur_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Beta.app"
    INSTALL_APP_PATH="/Applications/Install macOS Big Sur Beta.app"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS1016Seed1"
    DISK_IMAGE_SIZE="10G"
    REQUIRE_ENROLL=1
  9. niw revised this gist Aug 15, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ while getopts ":d:h" opts; do
    ;;
    h)
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, catalina, or catalina_beta"
    echo "name is either mojave, mojave_beta, catalina, catalina_beta, or bigsur_beta"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
  10. niw revised this gist Jun 23, 2020. 1 changed file with 19 additions and 5 deletions.
    24 changes: 19 additions & 5 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -60,18 +60,27 @@ case $NAME in
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    bigsur_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Beta.app"
    BUNDLE_ID="com.apple.InstallAssistant.Seed.macOS1016Seed1"
    DISK_IMAGE_SIZE="10G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    *)
    echo "Unknown name '$NAME'. See usage by give -h." >&2
    exit 1
    ;;
    esac
    readonly INSTALL_APP_PATH
    readonly MAC_APP_STORE_ID
    readonly BUNDLE_ID
    readonly DISK_IMAGE_SIZE
    readonly REQUIRE_ENROLL
    readonly DOWNLOAD_ASSETS

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" || \
    -r "$INSTALL_APP_PATH/Contents/SharedSupport/SharedSupport.dmg" ]]; then
    echo "Found the install app, create an install disk."
    if [[ ! -e $VOLUME_PATH ]]; then
    readonly DISK_IMAGE_NAME=$(basename "$VOLUME_PATH")
    @@ -102,8 +111,13 @@ else
    /usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist
    fi

    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"

    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    if [[ ! -z $MAC_APP_STORE_ID ]]; then
    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"
    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    elif [[ ! -z $BUNDLE_ID ]]; then
    # Open Preferences to download macOS installer app.
    /usr/bin/open "x-apple.systempreferences:com.apple.preferences.softwareupdate?client=bau&installMajorOSBundle=$BUNDLE_ID"
    echo "Click Download to download installer app, then run this script again to create an install disk image."
    fi
    fi
  11. niw revised this gist Mar 20, 2020. 1 changed file with 17 additions and 3 deletions.
    20 changes: 17 additions & 3 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -29,27 +29,36 @@ if [[ $(dirname "$VOLUME_PATH") != "/Volumes" ]]; then
    fi

    case $NAME in
    highsierra)
    INSTALL_APP_PATH="/Applications/Install macOS High Sierra.app"
    MAC_APP_STORE_ID="id1246284741"
    DISK_IMAGE_SIZE="8G"
    ;;
    mojave)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
    MAC_APP_STORE_ID="id1398502828"
    DISK_IMAGE_SIZE="8G"
    DOWNLOAD_ASSETS=1
    ;;
    mojave_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"
    MAC_APP_STORE_ID="id1354523149"
    DISK_IMAGE_SIZE="8G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    catalina)
    INSTALL_APP_PATH="/Applications/Install macOS Catalina.app"
    MAC_APP_STORE_ID="id1466841314"
    DISK_IMAGE_SIZE="10G"
    DOWNLOAD_ASSETS=1
    ;;
    catalina_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Catalina Beta.app"
    MAC_APP_STORE_ID="id1455661060"
    DISK_IMAGE_SIZE="10G"
    REQUIRE_ENROLL=1
    DOWNLOAD_ASSETS=1
    ;;
    *)
    echo "Unknown name '$NAME'. See usage by give -h." >&2
    @@ -60,6 +69,7 @@ readonly INSTALL_APP_PATH
    readonly MAC_APP_STORE_ID
    readonly DISK_IMAGE_SIZE
    readonly REQUIRE_ENROLL
    readonly DOWNLOAD_ASSETS

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk."
    @@ -72,10 +82,14 @@ if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    hdiutil attach "$DISK_IMAGE_NAME.dmg"
    fi

    ARGS=(--volume ${VOLUME_PATH})
    if ((DOWNLOAD_ASSETS)); then
    ARGS=("${ARGS[@]}" --downloadassets)
    fi
    readonly ARGS

    # Create an install disk.
    sudo "$INSTALL_APP_PATH/Contents/Resources/createinstallmedia" \
    --volume "$VOLUME_PATH" \
    --downloadassets
    sudo "$INSTALL_APP_PATH/Contents/Resources/createinstallmedia" "${ARGS[@]}"
    else
    if ((REQUIRE_ENROLL)); then
    echo "Enroll developer seed and open Mac App Store."
  12. niw revised this gist Nov 6, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -32,12 +32,12 @@ case $NAME in
    mojave)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
    MAC_APP_STORE_ID="id1398502828"
    DISK_IMAGE_SIZE="7G"
    DISK_IMAGE_SIZE="8G"
    ;;
    mojave_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"
    MAC_APP_STORE_ID="id1354523149"
    DISK_IMAGE_SIZE="7G"
    DISK_IMAGE_SIZE="8G"
    REQUIRE_ENROLL=1
    ;;
    catalina)
  13. niw revised this gist Oct 8, 2019. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -32,19 +32,23 @@ case $NAME in
    mojave)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
    MAC_APP_STORE_ID="id1398502828"
    DISK_IMAGE_SIZE="7G"
    ;;
    mojave_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"
    MAC_APP_STORE_ID="id1354523149"
    DISK_IMAGE_SIZE="7G"
    REQUIRE_ENROLL=1
    ;;
    catalina)
    INSTALL_APP_PATH="/Applications/Install macOS Catalina.app"
    MAC_APP_STORE_ID="id1466841314"
    DISK_IMAGE_SIZE="10G"
    ;;
    catalina_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Catalina Beta.app"
    MAC_APP_STORE_ID="id1455661060"
    DISK_IMAGE_SIZE="10G"
    REQUIRE_ENROLL=1
    ;;
    *)
    @@ -54,17 +58,17 @@ case $NAME in
    esac
    readonly INSTALL_APP_PATH
    readonly MAC_APP_STORE_ID
    readonly DISK_IMAGE_SIZE
    readonly REQUIRE_ENROLL

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk."
    if [[ ! -e $VOLUME_PATH ]]; then
    readonly DISK_IMAGE_NAME=$(basename "$VOLUME_PATH")

    echo "Creating a disk image '$DISK_IMAGE_NAME'"
    echo "Creating a disk image '$DISK_IMAGE_NAME' size $DISK_IMAGE_SIZE"

    # Mojave, Catalina install disk image requires about 8GB space.
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -volname "$DISK_IMAGE_NAME" -size 8G -layout SPUD -fs HFS+J && \
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -volname "$DISK_IMAGE_NAME" -size $DISK_IMAGE_SIZE -layout SPUD -fs HFS+J && \
    hdiutil attach "$DISK_IMAGE_NAME.dmg"
    fi

  14. niw revised this gist Oct 8, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -63,8 +63,8 @@ if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then

    echo "Creating a disk image '$DISK_IMAGE_NAME'"

    # Mojave, Catalina install disk image requires about 7GB space.
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -volname "$DISK_IMAGE_NAME" -size 7G -layout SPUD -fs HFS+J && \
    # Mojave, Catalina install disk image requires about 8GB space.
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -volname "$DISK_IMAGE_NAME" -size 8G -layout SPUD -fs HFS+J && \
    hdiutil attach "$DISK_IMAGE_NAME.dmg"
    fi

  15. niw revised this gist Oct 8, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ while getopts ":d:h" opts; do
    ;;
    h)
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, or catalina_beta"
    echo "name is either mojave, mojave_beta, catalina, or catalina_beta"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
  16. niw revised this gist Oct 8, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -88,4 +88,4 @@ else
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"

    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    fi
    fi
  17. niw revised this gist Oct 8, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -38,6 +38,10 @@ case $NAME in
    MAC_APP_STORE_ID="id1354523149"
    REQUIRE_ENROLL=1
    ;;
    catalina)
    INSTALL_APP_PATH="/Applications/Install macOS Catalina.app"
    MAC_APP_STORE_ID="id1466841314"
    ;;
    catalina_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Catalina Beta.app"
    MAC_APP_STORE_ID="id1455661060"
    @@ -84,4 +88,4 @@ else
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"

    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    fi
    fi
  18. niw revised this gist Jun 17, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ case $NAME in
    REQUIRE_ENROLL=1
    ;;
    catalina_beta)
    INSTALL_APP_PATH="/Applications/Install macOS 10.15 Beta.app"
    INSTALL_APP_PATH="/Applications/Install macOS Catalina Beta.app"
    MAC_APP_STORE_ID="id1455661060"
    REQUIRE_ENROLL=1
    ;;
  19. niw revised this gist Jun 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Creating a disk image '$DISK_IMAGE_NAME'"

    # Mojave, Catalina install disk image requires about 7GB space.
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -size 7G -layout SPUD -fs HFS+J && \
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -volname "$DISK_IMAGE_NAME" -size 7G -layout SPUD -fs HFS+J && \
    hdiutil attach "$DISK_IMAGE_NAME.dmg"
    fi

  20. niw revised this gist Jun 8, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -20,14 +20,14 @@ while getopts ":d:h" opts; do
    done
    readonly VOLUME_PATH

    shift $((OPTIND - 1))
    readonly NAME=$1

    if [[ $(dirname "$VOLUME_PATH") != "/Volumes" ]]; then
    echo "Invalid volume path '$VOLUME_PATH'" >&2
    exit 1
    fi

    shift $((OPTIND - 1))
    readonly NAME=$1

    case $NAME in
    mojave)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
  21. niw revised this gist Jun 8, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    set -e

    VOLUME_PATH=/Volumes/untitled
    VOLUME_PATH=/Volumes/installer
    while getopts ":d:h" opts; do
    case $opts in
    d)
  22. niw revised this gist Jun 8, 2019. 1 changed file with 29 additions and 11 deletions.
    40 changes: 29 additions & 11 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -2,16 +2,29 @@

    set -e

    while getopts ":h" opts; do
    VOLUME_PATH=/Volumes/untitled
    while getopts ":d:h" opts; do
    case $opts in
    d)
    VOLUME_PATH=$OPTARG
    ;;
    h)
    echo "Usage: $0 [-h] name"
    echo "Usage: $0 [-h] [-d disk] name"
    echo "name is either mojave, mojave_beta, or catalina_beta"
    echo " -h show this help message"
    echo " -h Show this help message"
    echo " -d /Volumes path to where it makes a bootable disk."
    echo " If it doesn't exist, it will create a disk image."
    exit 0
    ;;
    esac
    done
    readonly VOLUME_PATH

    if [[ $(dirname "$VOLUME_PATH") != "/Volumes" ]]; then
    echo "Invalid volume path '$VOLUME_PATH'" >&2
    exit 1
    fi

    shift $((OPTIND - 1))
    readonly NAME=$1

    @@ -31,7 +44,7 @@ case $NAME in
    REQUIRE_ENROLL=1
    ;;
    *)
    echo "Unknown name '$NAME'" >&2
    echo "Unknown name '$NAME'. See usage by give -h." >&2
    exit 1
    ;;
    esac
    @@ -40,15 +53,20 @@ readonly MAC_APP_STORE_ID
    readonly REQUIRE_ENROLL

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk image."
    echo "Found the install app, create an install disk."
    if [[ ! -e $VOLUME_PATH ]]; then
    readonly DISK_IMAGE_NAME=$(basename "$VOLUME_PATH")

    # Mojave install disk image requires about 7GB space.
    hdiutil create -o untitled.dmg -size 7G -layout SPUD -fs HFS+J && \
    hdiutil attach untitled.dmg
    echo "Creating a disk image '$DISK_IMAGE_NAME'"

    # Mojave, Catalina install disk image requires about 7GB space.
    hdiutil create -o "$DISK_IMAGE_NAME.dmg" -size 7G -layout SPUD -fs HFS+J && \
    hdiutil attach "$DISK_IMAGE_NAME.dmg"
    fi

    # Create an install disk image.
    # Create an install disk.
    sudo "$INSTALL_APP_PATH/Contents/Resources/createinstallmedia" \
    --volume /Volumes/untitled \
    --volume "$VOLUME_PATH" \
    --downloadassets
    else
    if ((REQUIRE_ENROLL)); then
    @@ -66,4 +84,4 @@ else
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"

    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    fi
    fi
  23. niw revised this gist Jun 5, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -64,4 +64,6 @@ else

    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"

    echo "Click Get on Mac App Store to download installer app, then run this script again to create an install disk image."
    fi
  24. niw revised this gist Jun 5, 2019. 1 changed file with 48 additions and 4 deletions.
    52 changes: 48 additions & 4 deletions download_macos_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,42 @@

    set -e

    readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
    readonly MAC_APP_STORE_ID="id1398502828"
    //readonly MAC_APP_STORE_ID="id1354523149" // macOS Mojave (Beta)
    while getopts ":h" opts; do
    case $opts in
    h)
    echo "Usage: $0 [-h] name"
    echo "name is either mojave, mojave_beta, or catalina_beta"
    echo " -h show this help message"
    exit 0
    ;;
    esac
    done
    shift $((OPTIND - 1))
    readonly NAME=$1

    case $NAME in
    mojave)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
    MAC_APP_STORE_ID="id1398502828"
    ;;
    mojave_beta)
    INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"
    MAC_APP_STORE_ID="id1354523149"
    REQUIRE_ENROLL=1
    ;;
    catalina_beta)
    INSTALL_APP_PATH="/Applications/Install macOS 10.15 Beta.app"
    MAC_APP_STORE_ID="id1455661060"
    REQUIRE_ENROLL=1
    ;;
    *)
    echo "Unknown name '$NAME'" >&2
    exit 1
    ;;
    esac
    readonly INSTALL_APP_PATH
    readonly MAC_APP_STORE_ID
    readonly REQUIRE_ENROLL

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk image."
    @@ -18,6 +51,17 @@ if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    --volume /Volumes/untitled \
    --downloadassets
    else
    if ((REQUIRE_ENROLL)); then
    echo "Enroll developer seed and open Mac App Store."
    echo "You can unenroll after downloading the install app by next command:"
    echo "sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil unenroll"

    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    /usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist
    fi

    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"
    fi
    fi
  25. niw renamed this gist May 26, 2019. 1 changed file with 0 additions and 0 deletions.
  26. niw revised this gist May 26, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions download_mojave_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@
    set -e

    readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"
    readonly MAC_APP_STORE_ID="id1398502828"
    //readonly MAC_APP_STORE_ID="id1354523149" // macOS Mojave (Beta)

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk image."
    @@ -16,6 +18,6 @@ if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    --volume /Volumes/untitled \
    --downloadassets
    else
    # Open Mac App Store to download macOS 10.14 Mojave.
    /usr/bin/open macappstores://itunes.apple.com/app/id1354523149
    # Open Mac App Store to download macOS installer app.
    /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID"
    fi
  27. niw revised this gist Dec 3, 2018. 1 changed file with 1 addition and 11 deletions.
    12 changes: 1 addition & 11 deletions download_mojave_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    set -e

    readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"
    readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave.app"

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk image."
    @@ -16,16 +16,6 @@ if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    --volume /Volumes/untitled \
    --downloadassets
    else
    echo "Enroll developer seed and open Mac App Store."
    echo "You can unenroll after downloading the install app by next command:"
    echo "sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil unenroll"

    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    #sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    # Probably this is not needed.
    #/usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist

    # Open Mac App Store to download macOS 10.14 Mojave.
    /usr/bin/open macappstores://itunes.apple.com/app/id1354523149
    fi
  28. niw revised this gist Sep 24, 2018. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions download_mojave_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -7,25 +7,25 @@ readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"
    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk image."

    # Mojave install disk image requires about 7GB space.
    # Mojave install disk image requires about 7GB space.
    hdiutil create -o untitled.dmg -size 7G -layout SPUD -fs HFS+J && \
    hdiutil attach untitled.dmg

    # Create an install disk image.
    # Create an install disk image.
    sudo "$INSTALL_APP_PATH/Contents/Resources/createinstallmedia" \
    --volume /Volumes/untitled \
    --downloadassets
    --volume /Volumes/untitled \
    --downloadassets
    else
    echo "Enroll developer seed and open Mac App Store."
    echo "You can unenroll after downloading the install app by next command:"
    echo "sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil unenroll"

    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    #sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    # Probably this is not needed.
    #/usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist
    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    #sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    # Probably this is not needed.
    #/usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist

    # Open Mac App Store to download macOS 10.14 Mojave.
    /usr/bin/open macappstores://itunes.apple.com/app/id1354523149
    # Open Mac App Store to download macOS 10.14 Mojave.
    /usr/bin/open macappstores://itunes.apple.com/app/id1354523149
    fi
  29. niw revised this gist Sep 4, 2018. 2 changed files with 31 additions and 9 deletions.
    9 changes: 0 additions & 9 deletions download_mojave.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +0,0 @@
    #!/bin/sh

    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    /usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist

    # Open Mac App Store to download macOS 10.14 Mojave.
    /usr/bin/open macappstores://itunes.apple.com/app/id1354523149
    31 changes: 31 additions & 0 deletions download_mojave_and_create_install_disk.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/usr/bin/env bash

    set -e

    readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave Beta.app"

    if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then
    echo "Found the install app, create an install disk image."

    # Mojave install disk image requires about 7GB space.
    hdiutil create -o untitled.dmg -size 7G -layout SPUD -fs HFS+J && \
    hdiutil attach untitled.dmg

    # Create an install disk image.
    sudo "$INSTALL_APP_PATH/Contents/Resources/createinstallmedia" \
    --volume /Volumes/untitled \
    --downloadassets
    else
    echo "Enroll developer seed and open Mac App Store."
    echo "You can unenroll after downloading the install app by next command:"
    echo "sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil unenroll"

    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    #sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    # Probably this is not needed.
    #/usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist

    # Open Mac App Store to download macOS 10.14 Mojave.
    /usr/bin/open macappstores://itunes.apple.com/app/id1354523149
    fi
  30. niw revised this gist Jul 3, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions download_mojave.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    #!/bin/sh

    # Tell Mac App Store that we've enrolled `DeveloperSeed`.
    # This is just for Mac App Store and it's not really enrolling. Actual `enroll` can be done by
    # sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    # Actual `enroll` is needed to download a complete install image from Mac App Store.
    sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
    /usr/libexec/PlistBuddy -c "clear dict" -c "add :SeedProgram string DeveloperSeed" /Users/Shared/.SeedEnrollment.plist

    # Open Mac App Store to download macOS 10.14 Mojave.