123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- on run (volumeName)
- tell application "Finder"
- tell disk (volumeName as string)
- open
- set theXOrigin to @_dmg_window_x@
- set theYOrigin to @_dmg_window_y@
- set theWidth to @_dmg_window_width@
- set theHeight to @_dmg_window_height@
- 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
- set position of every item to {theBottomRightX + 100, 100}
- end tell
- set opts to the icon view options of container window
- tell opts
- set icon size to @_dmg_icon_size@
- set text size to @_dmg_text_size@
- set arrangement to not arranged
- end tell
- set background picture of opts to file ".background:@_cpack_dmg_background_filename@"
- set position of item "@[email protected]" to {@_dmg_obs_x@, @_dmg_obs_y@}
- set position of item "Applications" to {@_dmg_app_link_x@, @_dmg_app_link_y@}
- close
- open
- -- 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
- 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
- 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
|