Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Last active December 8, 2025 08:50
Show Gist options
  • Select an option

  • Save Wowfunhappy/ced9aa23ddaaef7075f6c234f685e01b to your computer and use it in GitHub Desktop.

Select an option

Save Wowfunhappy/ced9aa23ddaaef7075f6c234f685e01b to your computer and use it in GitHub Desktop.
Download a Mac OS X 10.9 Mavericks installer image Apple

The Mac OS X 10.9 Mavericks download script is now hosted on Mavericks Forever. To download Mavericks, open a Terminal on any Mac and run:

curl mavericksforever.com/get.sh | sh

Or, navigate directly to mavericksforever.com/get.sh to read what the script does.

@Sixxdog-UK
Copy link

Last login: Mon Dec 1 01:16:03 on ttys000
/Users/alex/create-bootable-installer.command ; exit;
alex@Louises-MacBook-Air ~ % /Users/alex/create-bootable-installer.command ; exit;
Checksumming partition of size 0 blocks...done
Block checksum: ....10....20....30....40....50....60....70....80....90....100
successfully scanned image "/Users/alex/InstallMacOSXMavericks.dmg"
Please enter the volume name of your USB flash drive: Untitled
WARNING: All data on Untitled will be erased. Continue? (yes/no) yes
Password:
Started partitioning on disk2
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk2s2 as Mac OS Extended (Journaled) with name Untitled
Initialized /dev/rdisk2s2 as a 57 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
Finished partitioning on disk2
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *61.9 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS Untitled 61.5 GB disk2s2
Validating target...done
Validating source...done
Retrieving scan information...done
Validating sizes...done
Restoring ....10....20....30....40....50....60....70....80....90....100
Verifying ....10....20....30....40....50....60....70....80....90....100
Restored target device is /dev/disk2s2.
Remounting target volume...done
asr: Couldn't personalize volume /Volumes/OS X Base System - State not recoverable

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

@Wowfunhappy
Copy link
Author

Wowfunhappy commented Dec 1, 2025

So great news , after a few failed attempts (Could Not Unmount Volume etc.) , I found that having the finder window open showing the volume stopped it being unmounted for some weird reason. Also at the end I got an ASR error , but I think that was just trying to rename the USB.

Odd, I'm not immediately sure what to do about that. (I know you got it working but it's a shame it wasn't a smoother experience.)

One last question , any guess why the Installer I can download from an old OS App Store will not just work using the createmedia tool? and any idea why when I try to look inside the app contents the shared system InstallESD.dmg is reporting itself as corrupt?

If I recall correctly, the InstallESD.dmg inside the App Store's Mavericks installer was never restorable, even when Mavericks was current. But of course createinstallmedia worked at one point.

From what I understand, Apple updated the App Store Mavericks installer some years back to re-sign a certificate or something, but ended up breaking it. Or something like that, haven't looked into this closely—but It's not only broken for you!

@Sixxdog-UK
Copy link

Many thanks , that explains a lot.

Congrats again with the great work in automating the whole process. 👍👍

@Sixxdog-UK
Copy link

Hi there again.

So I’ve been working with ChatGPT to try and create a script to produce a working “Install OS X Mavericks.app” have had some progress but keep running into the wall where even if the InstallESD.dmg is the one downloaded from your script , once the .app is created and I try to use createinstallmedia tool , it just says This is not a valid OS X installer.

Any Thoughts?

This is the script we came up with.

#!/bin/bash
set -euo pipefail

----------------------

USER CONFIG

----------------------

BROKEN_APP_DIR="/Users/labtech4/Desktop/Broken App"
GOOD_ESD_DIR="/Users/labtech4/Desktop/Good ESD"
OUT_PARENT="/Users/labtech4/Desktop/Rebuilt Install OS X Mavericks App"

----------------------

PREPARE PATHS

----------------------

GOOD_ESD="$(find "$GOOD_ESD_DIR" -maxdepth 1 -type f -iname "InstallESD*.dmg" -print -quit || true)"
if [ -z "$GOOD_ESD" ]; then
echo "[ERROR] Cannot find InstallESD.dmg in $GOOD_ESD_DIR"
exit 1
fi

if [ -d "$BROKEN_APP_DIR" ] && [[ "$BROKEN_APP_DIR" == .app ]]; then
BROKEN_APP="$BROKEN_APP_DIR"
else
BROKEN_APP="$(find "$BROKEN_APP_DIR" -maxdepth 1 -type d -iname "Install
.app" -print -quit || true)"
if [ -z "$BROKEN_APP" ]; then
echo "[ERROR] Cannot find Install OS X Mavericks.app in $BROKEN_APP_DIR"
exit 1
fi
fi

mkdir -p "$OUT_PARENT"
STAGED_APP="$OUT_PARENT/Install OS X Mavericks.app"
WORKTMP="$(mktemp -d /tmp/mavericks_rebuild.XXXXXX)"
trap 'rm -rf "$WORKTMP"' EXIT

echo "Good ESD: $GOOD_ESD"
echo "Broken app: $BROKEN_APP"
echo "Output app: $STAGED_APP"
echo "Working temp: $WORKTMP"

----------------------

STEP 1: Mount good ESD

----------------------

hdiutil attach "$GOOD_ESD" -nobrowse -readonly >/dev/null
ESD_MOUNT="/Volumes/OS X Install ESD"

----------------------

STEP 2: Copy BaseSystem

----------------------

BASE_LOCAL="$WORKTMP/BaseSystem.dmg"
cp -p "$ESD_MOUNT/BaseSystem.dmg" "$BASE_LOCAL"
cp -p "$ESD_MOUNT/BaseSystem.chunklist" "$WORKTMP/"

----------------------

STEP 3: Convert to writable sparseimage

----------------------

SPARSE="$WORKTMP/BaseSystem.sparseimage"
hdiutil convert -ov "$BASE_LOCAL" -format UDSP -o "$SPARSE" >/dev/null
hdiutil resize -size 6500m "$SPARSE" >/dev/null

----------------------

STEP 4: Mount sparseimage in writable mode

----------------------

hdiutil attach "$SPARSE" -nobrowse -readwrite >/dev/null
MOUNT_BASE="/Volumes/OS X Base System"

----------------------

STEP 5: Copy Packages into BaseSystem

----------------------

rm -rf "$MOUNT_BASE/System/Installation/Packages" 2>/dev/null || true
mkdir -p "$MOUNT_BASE/System/Installation"
cp -R "$ESD_MOUNT/Packages" "$MOUNT_BASE/System/Installation/"

Copy BaseSystem files

cp -p "$ESD_MOUNT/BaseSystem.dmg" "$MOUNT_BASE/System/Installation/"
cp -p "$ESD_MOUNT/BaseSystem.chunklist" "$MOUNT_BASE/System/Installation/"

----------------------

STEP 6: Detach sparse and ESD

----------------------

hdiutil detach "$MOUNT_BASE" >/dev/null
hdiutil detach "$ESD_MOUNT" >/dev/null

----------------------

STEP 7: Convert sparseimage to final DMG

----------------------

OUT_DMG="$WORKTMP/InstallMacOSXMavericks.dmg"
hdiutil convert -ov "$SPARSE" -format UDZO -o "$OUT_DMG" >/dev/null

----------------------

STEP 8: Build app structure

----------------------

rm -rf "$STAGED_APP"
mkdir -p "$STAGED_APP/Contents/SharedSupport"
mkdir -p "$STAGED_APP/Contents/Resources"
mkdir -p "$STAGED_APP/Contents/Frameworks"
mkdir -p "$STAGED_APP/Contents/MacOS"

Copy broken app resources

cp -R "$BROKEN_APP/Contents/Resources/"* "$STAGED_APP/Contents/Resources/" 2>/dev/null || true
cp -R "$BROKEN_APP/Contents/Frameworks/"* "$STAGED_APP/Contents/Frameworks/" 2>/dev/null || true

Place rebuilt DMG in SharedSupport

cp -p "$OUT_DMG" "$STAGED_APP/Contents/SharedSupport/InstallESD.dmg"

Copy InstallableMachines.plist

if [ -f "$ESD_MOUNT/Packages/InstallableMachines.plist" ]; then
cp -p "$ESD_MOUNT/Packages/InstallableMachines.plist" "$STAGED_APP/Contents/SharedSupport/"
fi

createinstallmedia

if [ -f "$BROKEN_APP/Contents/Resources/createinstallmedia" ]; then
cp -p "$BROKEN_APP/Contents/Resources/createinstallmedia" "$STAGED_APP/Contents/Resources/"
chmod +x "$STAGED_APP/Contents/Resources/createinstallmedia"
else
cat > "$STAGED_APP/Contents/Resources/createinstallmedia" <<'CIM'
#!/bin/sh
echo "Use ASR restore method; createinstallmedia not included."
exit 1
CIM
chmod +x "$STAGED_APP/Contents/Resources/createinstallmedia"
fi

Minimal Info.plist

cat > "$STAGED_APP/Contents/Info.plist" <<'EOF'

CFBundleIdentifier com.apple.InstallAssistant.Mavericks CFBundleName Install OS X Mavericks CFBundleVersion 1 CFBundleExecutable InstallAssistant EOF

----------------------

STEP 9: Fix permissions

----------------------

xattr -cr "$STAGED_APP" >/dev/null 2>&1 || true
chmod -R 755 "$STAGED_APP"
chown -R "$(whoami)":staff "$STAGED_APP"

echo
echo "=== Rebuild complete! ==="
echo "Rebuilt app location: $STAGED_APP"

----------------------

STEP 10: CREATE BOOTABLE USB WITH DATE FIX

----------------------

echo
echo "Do you want to create a bootable USB now? (This will erase the selected disk) [y/N]: "
read -r CREATE_USB
if [[ "$CREATE_USB" =~ ^[Yy]$ ]]; then
echo "Available volumes:"
ls /Volumes
echo
echo "Enter the name of the USB drive exactly as it appears in /Volumes (will be erased): "
read -r USB_VOL

DISK_ID=$(diskutil info "/Volumes/$USB_VOL" | awk '/Part of Whole/ {print $NF}')
if [ -z "$DISK_ID" ]; then
echo "[ERROR] Could not determine disk identifier for $USB_VOL"
exit 1
fi

echo
echo "All data on $USB_VOL ($DISK_ID) will be erased! Confirm by typing YES: "
read -r CONFIRM
if [ "$CONFIRM" != "YES" ]; then
echo "Aborting USB creation."
exit 1
fi

Save current date

CURRENT_DATE=$(date "+%m%d%H%M%Y")

Set safe date for installer

echo "Temporarily setting system date to Jan 1, 2015 to avoid certificate errors..."
sudo date 0101010115

echo "Creating bootable USB..."
sudo "$STAGED_APP/Contents/Resources/createinstallmedia"
--volume "/Volumes/$USB_VOL"
--applicationpath "$STAGED_APP"
--nointeraction

Restore original date

echo "Restoring original system date..."
sudo date "$CURRENT_DATE"

echo "Bootable USB created on $USB_VOL"
else
echo "USB creation skipped. You can use createinstallmedia manually."
fi

echo "Done."

@Sixxdog-UK
Copy link

Basically trying to fix what Apple broke , when you download the installer app from the old App Store , it can’t validate the InstallESD.dmg but the one your script downloads is valid . Trying to merge the two together to create a working .app is proving tricky. 🤦🏻‍♂️🤦🏻‍♂️

@Wowfunhappy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment