Browse files

Merge pull request #2 from jendave/master

Removal of AdiumAppleScriptRunner dep so it can run on Lion
  • Loading branch information...
2 parents 84e6566 + ac45cc4 commit 2e4f1959eb8df1d3aa99c152fa0b7879b4d7593b @andreyvit committed Aug 26, 2011
Showing with 12 additions and 49 deletions.
  1. +4 −5 create-dmg
  2. BIN support/AdiumApplescriptRunner
  3. +8 −44 support/template.applescript
View
9 create-dmg
@@ -12,7 +12,7 @@
set -e;
function pure_version() {
- echo '[[ver]]'
+ echo '1.0.0.2'
}
function version() {
@@ -131,15 +131,14 @@ fi
APPLESCRIPT=$(mktemp -t createdmg)
cat "$AUX_PATH/template.applescript" | sed -e "s/WINX/$WINX/g" -e "s/WINY/$WINY/g" -e "s/WINW/$WINW/g" -e "s/WINH/$WINH/g" -e "s/BACKGROUND_CLAUSE/$BACKGROUND_CLAUSE/g" -e "s/ICON_SIZE/$ICON_SIZE/g" | perl -pe "s/POSITION_CLAUSE/$POSITION_CLAUSE/g" >"$APPLESCRIPT"
-echo "Running Applescript: ./AdiumApplescriptRunner \"${APPLESCRIPT}\" process_disk_image \"${VOLUME_NAME}\""
-"$AUX_PATH/AdiumApplescriptRunner" "${APPLESCRIPT}" process_disk_image "${VOLUME_NAME}" || true
+echo "Running Applescript: /usr/bin/osascript \"${APPLESCRIPT}\" \"${VOLUME_NAME}\""
+"/usr/bin/osascript" "${APPLESCRIPT}" "${VOLUME_NAME}" || true
echo "Done running the applescript..."
sleep 4
# make sure it's not world writeable
echo "Fixing permissions..."
-# workaround: output is sent to /dev/null to supress permission errors when chmodding .Trashes
-chmod -Rf go-w "${MOUNT_DIR}" >& /dev/null || true
+chmod -Rf go-w "${MOUNT_DIR}" &> /dev/null || true
echo "Done fixing permissions."
# make the top window open itself on mount:
View
BIN support/AdiumApplescriptRunner
Binary file not shown.
View
52 support/template.applescript
@@ -1,8 +1,4 @@
-on run -- for testing in script editor
- process_disk_image("Adium X 1.0b20", "/Users/evands/adium-1.0/Release/Artwork")
-end run
-
-on process_disk_image(volumeName)
+on run (volumeName)
tell application "Finder"
tell disk (volumeName as string)
open
@@ -15,7 +11,6 @@ on process_disk_image(volumeName)
set theBottomRightX to (theXOrigin + theWidth)
set theBottomRightY to (theYOrigin + theHeight)
set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""
- -- do shell script "rm " & dsStore
tell container window
set current view to icon view
@@ -30,26 +25,15 @@ on process_disk_image(volumeName)
set icon size to ICON_SIZE
set arrangement to not arranged
end tell
- -- set background picture of opts to file ".background:background.png"
BACKGROUND_CLAUSE
-- Positioning
POSITION_CLAUSE
- -- set position of item "Adium.app" to {196, 273}
-
- -- Custom icons
- -- my copyIconOfTo(artPath & "/ApplicationsIcon", "/Volumes/" & volumeName & "/Applications")
-
- -- Label colors
- -- set label index of item "Adium.app" to 6
- -- set label index of item "License.txt" to 7
- -- set label index of item "Changes.txt" to 7
- -- set label index of item "Applications" to 4
update without registering applications
-- Force saving of the size
- delay 1
-
+ delay 1
+
tell container window
set statusbar visible to false
set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
@@ -58,7 +42,7 @@ on process_disk_image(volumeName)
update without registering applications
end tell
- delay 1
+ delay 1
tell disk (volumeName as string)
tell container window
@@ -67,11 +51,11 @@ on process_disk_image(volumeName)
end tell
update without registering applications
- end tell
+ end tell
--give the finder some time to write the .DS_Store file
- delay 3
-
+ delay 3
+
set waitTime to 0
set ejectMe to false
repeat while ejectMe is false
@@ -82,24 +66,4 @@ on process_disk_image(volumeName)
end repeat
log "waited " & waitTime & " seconds for .DS_STORE to be created."
end tell
-end process_disk_image
-
-on copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)
- tell application "Finder" to set f to POSIX file aFileOrFolderWithIcon as alias
- -- grab the file's icon
- my CopyOrPaste(f, "c")
- -- now the icon is in the clipboard
- tell application "Finder" to set c to POSIX file aFileOrFolder as alias
- my CopyOrPaste(result, "v")
-end copyIconOfTo
-
-on CopyOrPaste(i, cv)
- tell application "Finder"
- activate
- open information window of i
- end tell
- tell application "System Events" to tell process "Finder" to tell window 1
- keystroke tab -- select icon button
- keystroke (cv & "w") using command down (* (copy or paste) + close window *)
- end tell -- window 1 then process Finder then System Events
-end CopyOrPaste
+end run

0 comments on commit 2e4f195

Please sign in to comment.