东坡网 - 更多系统软件下载,请关注东坡网:www.dongpow.com

当前位置:首页 > 系统教程 > Linux教程 > 详细页面

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

时间:2017-08-17来源:东坡网作者: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文件有更深入的认识。

12 下一页
分享到:

相关信息

  • linux检测及防止DDOS攻击的技巧

    身为一个网站的站长,不仅要保证网站的流量提升,还要预防DDOS攻击,那么在Linux系统下要如何检测DDOS攻击呢?又该如何防止DDOS攻击呢?这都是一门学问。...

    2023-03-16

  • 惠普笔记本Debian编译声卡驱动的方法

    在惠普笔记本上安装完Debian系统后,声音出现了问题,多半是声卡驱动故障,这时可重新安装编译声卡驱动解决问题,下面小编就给大家详细介绍下Debian编译安装声卡驱动的方法。...

    2023-03-16

系统教程栏目

栏目热门教程

人气教程排行

站长推荐

热门系统下载

公众号