forked from monash-merc/cvl-fabric-launcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MAC_DMG_BUILD.txt
56 lines (50 loc) · 2.51 KB
/
MAC_DMG_BUILD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
The MASSIVE Launcher.dmg disk image can be created using the method described
here:
http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools
The exact steps used are shown below.
This assumes that the MASSIVE Launcher.app bundle has been copied to a separate
folder, called "dmg", to distinguish it from the "dist" folder which may contain
additional files, which are not required in the disk image.
The dmgBackgroundMacOSX.png image file provides the background image for the disk image,
which displays an arrow, telling the user to drag the MASSIVE Launcher.app
bundle into (a symbolic link to) their Applications folder.
mkdir ~/Desktop/dmg/
mv dist/MASSIVE\ Launcher.app/ ~/Desktop/dmg/
cd ~/Desktop/
source=~/Desktop/dmg
title="MASSIVE Launcher"
size=80000
applicationName="MASSIVE Launcher"
finalDMGName="MASSIVE Launcher"
backgroundPictureName=~/Desktop/cvl_svn/launcher/trunk/dmgBackgroundMacOSX.png
hdiutil create -srcfolder "${source}" -volname "${title}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${size}k pack.temp.dmg
device=$(hdiutil attach -readwrite -noverify -noautoopen "pack.temp.dmg" | egrep '^/dev/' | sed 1q | awk '{print $1}')
cp ~/Desktop/cvl_svn/launcher/trunk/dmgBackgroundMacOSX.png /Volumes/MASSIVE\ Launcher/.background/
echo '
tell application "Finder"
tell disk "'${title}'"
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 885, 430}
set theViewOptions to the icon view options of container window
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 96
set background picture of theViewOptions to file ".background:'${backgroundPictureName}'"
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
set position of item "'${applicationName}'" of container window to {120, 163}
set position of item "Applications" of container window to {375, 163}
close
open
update without registering applications
end tell
end tell
' | osascript
sudo chmod -Rf go-w /Volumes/"${title}"
sync
sync
hdiutil detach ${device}
rm -f "${finalDMGName}.dmg"
hdiutil convert "pack.temp.dmg" -format UDZO -imagekey zlib-level=9 -o "${finalDMGName}"
rm -f pack.temp.dmg