5 TMPNAME="${NAME// /_}_Installer"
14 ln -s /Applications " "
17 cp "${WDIR}/background.png" .background/background.png
19 [ -e "$DMG" ] && rm "$DMG"
20 hdiutil create -volname "$TMPNAME" -srcfolder "$TMPNAME" -size 1m -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "$DMG"
25 VOL="/Volumes/${TMPNAME}"
26 #osascript "${WDIR}/set_ds_store.applescript" "$TMPNAME" "$APPNAME"
27 osascript - "$TMPNAME" "$APPNAME" <<EOF
28 on run {volumeName, appName}
29 tell application "Finder"
30 tell disk (volumeName as string)
38 set theBottomRightX to (theXOrigin + theWidth)
39 set theBottomRightY to (theYOrigin + theHeight)
42 set current view to icon view
43 set toolbar visible to false
44 set statusbar visible to false
45 set pathbar visible to false
46 set bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY + 220}
47 set statusbar visible to false
48 set position of every item to {100, theBottomRightY + 150}
51 set opts to the icon view options of container window
55 set label position to bottom
56 set arrangement to not arranged
59 set background picture of opts to file ".background:background.png"
61 set position of item (appName as string) to {133, 124}
62 set position of item " " to {336, 124}
65 set bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
77 DSSTORE="${VOL}/.DS_Store"
78 until [ -e "$DSSTORE" ] && grep background.png "$DSSTORE"; do
80 echo "Waiting for \"$DSSTORE\" to update"
83 SAVED_DSSTORE="${TMPNAME}-DS_Store"
84 cp "$DSSTORE" "${WDIR}/${SAVED_DSSTORE}"
85 echo "Created new .DS_Store as \"$SAVED_DSSTORE\""
90 rm -r "/tmp/${TMPNAME}"