Skip to content

Commit

Permalink
Make packaging script wait for the disk image to be mounted.
Browse files Browse the repository at this point in the history
Frequently the apple script would execute before the disk image had been
fully mounted, and would fail. We now try to wait for the disk to be
mounted first.
  • Loading branch information
Robert Maynard committed May 19, 2016
1 parent 6bf6482 commit d381243
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Packaging/CMakeDMGSetup.scpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ on run argv
tell application "Finder"
tell disk image_name

-- wait for the image to finish mounting
set open_attempts to 0
repeat while open_attempts < 4
try
open
delay 1
set open_attempts to 5
close
on error errStr number errorNumber
set open_attempts to open_attempts + 1
delay 10
end try
end repeat
delay 5

-- open the image the first time and save a DS_Store with just
-- background and icon setup
open
Expand All @@ -12,7 +27,7 @@ on run argv
set background picture of theViewOptions to file ".background:background.tif"
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 128
delay 1
delay 5
close

-- next setup the position of the app and Applications symlink
Expand All @@ -28,7 +43,7 @@ on run argv
set position of item "Applications" to { 378, 200 }
end tell
update without registering applications
delay 1
delay 5
close

-- one last open and close so you can see everything looks correct
Expand Down

0 comments on commit d381243

Please sign in to comment.