系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux通過命令行建立dmg文件

Linux通過命令行建立dmg文件的方法(2)

時間: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)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

掃碼關注
掃碼關注

掃碼關注 官方交流群 軟件收錄