Skip to content

Commit

Permalink
Mac OS X: Another attempt to fix DMG template for Lion
Browse files Browse the repository at this point in the history
Tried to modify template background picture with a script, but to
no avail.
  • Loading branch information
skyjake committed Apr 6, 2012
1 parent 9b731c7 commit 16252dc
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
5 changes: 3 additions & 2 deletions distrib/platform_release.py
Expand Up @@ -241,8 +241,9 @@ def mac_release():
duptree('Doomsday Engine.app', 'imaging/Doomsday Engine.app')
shutil.copy(os.path.join(DOOMSDAY_DIR, "doc/output/Read Me.rtf"), 'imaging/Read Me.rtf')

os.system('/usr/sbin/diskutil rename ' + os.path.abspath('imaging') +
' "' + "Doomsday Engine " + DOOMSDAY_VERSION_FULL + '"')
volumeName = "Doomsday Engine " + DOOMSDAY_VERSION_FULL
os.system('/usr/sbin/diskutil rename ' + os.path.abspath('imaging') + ' "' + volumeName + '"')
#os.system("osascript %s/template-image/template.applescript \"%s\"" % (SNOWBERRY_DIR, volumeName))

os.system('hdiutil detach -quiet imaging')
os.system('hdiutil convert imaging.sparseimage -format UDZO -imagekey zlib-level=9 -o "' + target + '"')
Expand Down
75 changes: 75 additions & 0 deletions snowberry/template-image/template.applescript
@@ -0,0 +1,75 @@
on run (volumeName)
tell application "Finder"
tell disk (volumeName as string)
open

--set theXOrigin to WINX
--set theYOrigin to WINY
--set theWidth to WINW
--set theHeight to WINH

--set theBottomRightX to (theXOrigin + theWidth)
--set theBottomRightY to (theYOrigin + theHeight)

set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""

tell container window
set current view to icon view
set toolbar visible to false
set statusbar visible to false
-- set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
-- set statusbar visible to false
end tell

set opts to the icon view options of container window
tell opts
--set icon size to ICON_SIZE
set arrangement to not arranged
set background picture to file ("/Volumes/" & volumeName & "/" & ".background/diskbg.jpg")
end tell

-- Positioning
--POSITION_CLAUSE

-- Application Link Clause
--APPLICATION_CLAUSE
close
open

update without registering applications
-- Force saving of the size
delay 1

tell container window
set statusbar visible to false
--set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
end tell

update without registering applications
end tell

delay 1

--tell disk (volumeName as string)
-- tell container window
-- set statusbar visible to false
-- set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
-- end tell

-- update without registering applications
--end tell

--give the finder some time to write the .DS_Store file
delay 3

--set waitTime to 0
--set ejectMe to false
--repeat while ejectMe is false
-- delay 1
-- set waitTime to waitTime + 1
--
-- if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true
--end repeat
--log "waited " & waitTime & " seconds for .DS_STORE to be created."
end tell
end run

0 comments on commit 16252dc

Please sign in to comment.