时间:2017-08-17 19:55:51来源:魔法系统之家下载作者:qipeng
# 增加Applications目录的软链接
echo “Add link to /Applications”
pushd /Volumes/“${VOL_NAME}”
ln -s /Applications
popd
# 拷贝背景图片
mkdir /Volumes/“${VOL_NAME}”/.background
cp “${DMG_BACKGROUND_IMG}” /Volumes/“${VOL_NAME}”/.background/
# 使用applescript设置一系列的窗口属性
echo ‘
tell application “Finder”
tell disk “’${VOL_NAME}‘”
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, 938, 432}
set viewOptions to the icon view options of container window
set arrangement of viewOptions to not arranged
set icon size of viewOptions to 72
set background picture of viewOptions to file “.background:’${DMG_BACKGROUND_IMG}‘”
set position of item “’${APP_NAME}‘.app” of container window to {160, 195}
set position of item “Applications” of container window to {360, 195}
close
open
update without registering applications
delay 2
end tell
end tell
’ | osascript
sync
# 卸载
hdiutil detach “${DEVICE}”
压缩dmg
echo “Creating compressed image”
hdiutil convert “${DMG_TMP}” -format UDZO -imagekey zlib-level=9 -o “${DMG_FINAL}”
# 清理文件夹
rm -rf “${DMG_TMP}”
rm -rf “${STAGING_DIR}”
echo ‘Done.’
exit
上面就是Linux使用命令行创建dmg文件的方法介绍了,上文对什么是dmg文件做了详细介绍,让用户对dmg文件有更深入的认识。
2017-08-17
如何修复一个Panic的Linux内核?2017-08-17
Linux删除文件(夹)、创建文件(夹)命令是什么?2017-08-17
Linux系统如何配置双显卡?为什么Arch Linux不适合当作服务器操作系统?可能很多用户都发现了,Linux服务器操作系统一般都是Ubuntu Server、Cent OS、Fedora或者Red Hat等,为什么很少看到Arch Linux呢?因为Arch Linux在服务方面确实存在一些劣势,下面...
2017-08-17
有些用户为了使桌面更好看、更具动感性,于是就想要设置系统的3D桌面特效,不过不少人却不知道Ubuntu 3D桌面特效怎么设置?其实方法很简单,如果你不知道的话,那就赶紧来看看小编整理的Ubuntu 3D桌面特效设置方法吧!...
2017-08-17