Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Last active February 17, 2026 17:43
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.

@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

@Sixxdog-UK
Copy link

Hi Jonathan,

Thanks for the feedback , it was just a fun experiment and I learnt a lot from doing it.

Nice to know it’s been tried before and not just me being hopeless. 😆

Just as a side note , did you know that the certificate issues don’t just effect mavericks , if you download an installer from an old version of the AppStore , the InstallESD.dmg still can’t be opened. Not such a problem as we have links to download everything else , just a curious side note.

Thanks again for your brilliant work.

sixx

@klepsd
Copy link

klepsd commented Feb 17, 2026

Please update this script. Unfortunately, I tried to restore the Mavericks installer using the restore command script to a specific drive partition. It erased the entire drive, I lost a lot of important files.

@Wowfunhappy
Copy link
Author

Wowfunhappy commented Feb 17, 2026

Oh no, I'm so sorry you lost data!

The USB creation script does need to repartition the entire disk in order to ensure a GUID Partition Table. I've updated the warning message to make this more explicit:

WARNING: Everything on the disk containing $target_volname will be erased. Continue? (yes/no)

The entire reason this part of the script exists is because I kept getting emails from people who ran into trouble doing the restore manually via Disk Utility. Most of these users have no idea what a partition is, or that a disk can have more than one. I do still recommend using Disk Utility for more complex disk layouts.

It's really tricky to come up with phrasing that will accurately inform a more technical user without confusing a less-technical one. Even with the current phrasing, I'm worried some people will think that their entire computer will be erased or something.

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