Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge branch 'mavericks'
Browse files Browse the repository at this point in the history
  • Loading branch information
Per Olofsson authored and Per Olofsson committed Oct 29, 2013
2 parents f36e42b + 9dd3e8d commit ac3e732
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Create Recovery Partition Installer.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1.1</string>
<key>LSMinimumSystemVersion</key>
<string>10.5.0</string>
<string>10.7.0</string>
<key>LSUIElement</key>
<false/>
<key>NSHumanReadableCopyright</key>
<string>© 2012 Per Olofsson, University of Gothenburg</string>
<string>© 2013 Per Olofsson, University of Gothenburg</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
24 changes: 18 additions & 6 deletions Create Recovery Partition Installer.app/Contents/Resources/script
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ COCOADIALOG_PATH="cocoaDialog.app"

# Clean up on exit.
cleanup_exit() {
if [ ! -z "$basesystemvol" ]; then
hdiutil eject -quiet "$basesystemvol"
fi
if [ ! -z "$sysvol" ]; then
hdiutil eject -quiet "$sysvol"
fi
Expand Down Expand Up @@ -136,16 +139,25 @@ fi

# Check system version.
if [ -f "$sysvol/$VER_PLIST_PATH" ]; then
ProductBuildVersion=$( plist_read "$sysvol/$VER_PLIST_PATH" ProductBuildVersion )
ProductCopyright=$( plist_read "$sysvol/$VER_PLIST_PATH" ProductCopyright )
ProductName=$( plist_read "$sysvol/$VER_PLIST_PATH" ProductName )
ProductUserVisibleVersion=$( plist_read "$sysvol/$VER_PLIST_PATH" ProductUserVisibleVersion )
ProductVersion=$( plist_read "$sysvol/$VER_PLIST_PATH" ProductVersion )
echo "Found $ProductName $ProductUserVisibleVersion $ProductBuildVersion © $ProductCopyright."
version_plist="$sysvol/$VER_PLIST_PATH"
# if DMG is 10.9, it is the BaseSystem.dmg within that will contain the system version info
elif [ -f "$sysvol/BaseSystem.dmg" ]; then
basesystemvol=$( hdiutil attach -nobrowse -mountrandom /tmp -noverify "$sysvol/BaseSystem.dmg" | grep Apple_HFS | awk '{print $3}' )
if [ $? -ne 0 ]; then
error_exit "Mount of $basesystemvol failed\!"
fi
version_plist="$basesystemvol/$VER_PLIST_PATH"
else
error_exit "No system found\!"
fi

ProductBuildVersion=$( plist_read "$version_plist" ProductBuildVersion )
ProductCopyright=$( plist_read "$version_plist" ProductCopyright )
ProductName=$( plist_read "$version_plist" ProductName )
ProductUserVisibleVersion=$( plist_read "$version_plist" ProductUserVisibleVersion )
ProductVersion=$( plist_read "$version_plist" ProductVersion )
echo "Found $ProductName $ProductUserVisibleVersion $ProductBuildVersion © $ProductCopyright."

# Ask user for a pkg name.
output_pkg=$( cocoaDialog filesave --title "Create Recovery Partition Installer" --text "Enter name for package" --with-extensions ".pkg" --with-directory ~/Downloads --with-file "RecoveryPartitionInstaller-$ProductUserVisibleVersion.pkg" )
if [ -z "$output_pkg" ]; then
Expand Down

0 comments on commit ac3e732

Please sign in to comment.