-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# DMG 构建说明 | ||
|
||
创建 mos 安装用的 dmg, 使用 create-dmg 脚本实现 | ||
|
||
先安装 https://github.com/create-dmg/create-dmg | ||
|
||
然后东西都丢到 Mos 的 dmg 目录下 | ||
|
||
- dmg-bg.png DMG 的背景图, 分辨率 700x400 | ||
|
||
- dmg-icon.png DMG 的图标, 分辨率 1204*1024 | ||
|
||
- Mos, 应用本体 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# 创建 mos 安装用的 dmg, 使用 create-dmg 脚本实现 | ||
# 先安装 https://github.com/create-dmg/create-dmg | ||
# 然后东西都丢到 Mos 的 dmg 目录下 | ||
# - dmg-bg.png DMG 的背景图, 分辨率 700x400 | ||
# - dmg-icon.png DMG 的图标, 分辨率 1204*1024 | ||
# - Mos, 应用本体 | ||
|
||
# 设置变量 | ||
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "Mos.app/Contents/Info.plist") | ||
|
||
echo "开始构建 DMG..." | ||
|
||
echo "清除遗留文件" | ||
rm -f Mos.*.dmg | ||
|
||
echo "生成 dmg-icon.png 对应的 icns 文件" | ||
mkdir tmp.iconset && cp dmg-icon.png tmp.iconset/[email protected] && iconutil -c icns tmp.iconset -o tmp.icns && rm -rf tmp.iconset | ||
|
||
echo "创建 DMG" | ||
create-dmg \ | ||
--volname "Mos" \ | ||
--volicon "tmp.icns" \ | ||
--background "dmg-bg.png" \ | ||
--window-pos 200 120 \ | ||
--window-size 700 400 \ | ||
--icon-size 150 \ | ||
--icon "Mos.app" 170 205 \ | ||
--app-drop-link 535 195 \ | ||
--hide-extension "Mos.app" \ | ||
--no-internet-enable \ | ||
"Mos.${VERSION}.dmg" \ | ||
"Mos.app" | ||
|
||
echo "删除临时创建的图标" | ||
rm -f tmp.icns | ||
|
||
echo "构建完成" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.