熱搜:win11繞過硬件限制安裝 一鍵重裝Win10系統(tǒng) 最干凈的u盤啟動盤 真正純凈版的win7系統(tǒng)
時間:2015-06-19 17:23:59 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時看資訊 2. 請使用手機瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20150619/51229.html 手機查看 評論 反饋
# 增加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使用命令行創(chuàng)建dmg文件的方法介紹了,上文對什么是dmg文件做了詳細介紹,讓用戶對dmg文件有更深入的認識。
發(fā)表評論
共0條
評論就這些咯,讓大家也知道你的獨特見解
立即評論以上留言僅代表用戶個人觀點,不代表系統(tǒng)之家立場