diff --git a/README.md b/README.md index 01f5122..f998052 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Build macOS Installer ISO and DMG image via Github Action – No Mac Required +## Build macOS Installer image via Github Action – No Mac Required * Support **macOS 10.7 Lion** through **macOS 26 Tahoe** installers. * Download macOS installers exclusively from official Apple sources. @@ -15,10 +15,10 @@ > [!IMPORTANT] > * Use the **"Build macOS Recovery ISO image"** workflow unless you really need an offline installer. > * GitHub-hosted runners are a free public resource — please use them responsibly. -> * Already have macOS? Build macOS installer ISO/DMG image with this command (replace tahoe with the desired version): -> ``` -> curl -L https://raw.githubusercontent.com/LongQT-sea/macos-iso-builder/main/mkmaciso | bash -s tahoe -> ``` +> * Already have macOS? Build macOS installer ISO/DMG image with this command (replace `tahoe` with the desired version): +``` +curl -L https://raw.githubusercontent.com/LongQT-sea/macos-iso-builder/main/mkmaciso | bash -s tahoe +``` --- diff --git a/mkmaciso b/mkmaciso index 780ee80..c75e627 100644 --- a/mkmaciso +++ b/mkmaciso @@ -542,7 +542,8 @@ download_legacy_macos() { esac log_info "Downloading macOS $(get_codename $version_num)..." - curl --progress-bar -L "$download_url" -o "$WORK_DIR/InstallMacOSX.dmg" + # If download does not finish within 20 minutes (--max-time 1200), redownload to establish a new connection, which may result in faster speeds. + curl --retry 5 --retry-all-errors --max-time 1200 --connect-timeout 10 --progress-bar -L "$download_url" -o "$WORK_DIR/InstallMacOSX.dmg" } # macOS 10.9 Mavericks requires special handling: @@ -594,8 +595,9 @@ k=$key") log_info "Downloading macOS Mavericks using special method..." # Download Mavericks InstallESD.dmg and cache it in /Applications to avoid redownload in the future - curl --progress-bar "$mavericks_url" -H "Cookie: AssetToken=$token" > "$WORK_DIR/InstallESD.dmg" && mkdir -p "/Applications/Install OS X Mavericks.app/Contents/SharedSupport" - + # If download does not finish within 20 minutes (--max-time 1200), redownload to establish a new connection, which may result in faster speeds. + curl --retry 5 --retry-all-errors --max-time 1200 --connect-timeout 10 --progress-bar "$mavericks_url" -H "Cookie: AssetToken=$token" -o "$WORK_DIR/InstallESD.dmg" && mkdir -p "/Applications/Install OS X Mavericks.app/Contents/SharedSupport" + if [ -d "/Applications/Install OS X Mavericks.app/Contents/SharedSupport" ]; then mv -f "$WORK_DIR/InstallESD.dmg" "/Applications/Install OS X Mavericks.app/Contents/SharedSupport/InstallESD.dmg" fi