Ai
0 Star 2 Fork 2

Crogram Pythub/pythub-builder

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pkg.sh 1022 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jackson 提交于 2025-05-14 13:03 +08:00 . 发布更新 v1.1.0
#!/bin/bash
appName="PythubBuilder"
# MacDeveloperID="3rd Party Mac Developer Installer: Developer Name (XXXX)"
MacDeveloperID="Developer ID Installer: CROGRAM INC. (4LWSS9P873)"
# rm -rf ./build/pkg
mkdir ./build/pkg
appPath=./dist/"$appName".app
pkgPath=./dist/"$appName".pkg
# 生成中间 PKG 文件
pkgbuild --install-location /Applications --component "$appPath" ./build/pkg/intermediate.pkg
cd ./build/pkg
# 创建分发 XML 文件
productbuild --synthesize --package ./intermediate.pkg ./distribution.xml
# 生成最终的 PKG 文件。此 PKG 文件未签名
productbuild --distribution ./distribution.xml --package-path ./intermediate.pkg ./unsigned_final.pkg
if ["$MacDeveloperID" = ""]; then
# 未签名
mv ./unsigned_final.pkg ./final.pkg
else
# 使用 Mac 开发人员 ID 证书对 PKG 文件进行签名
productsign --sign "$MacDeveloperID" ./unsigned_final.pkg ./signed_final.pkg
mv ./signed_final.pkg ./final.pkg
fi
cd -
# rm "$pkgPath"
mv ./build/pkg/final.pkg "$pkgPath"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/pythub/pythub-builder.git
git@gitee.com:pythub/pythub-builder.git
pythub
pythub-builder
pythub-builder
main

搜索帮助