File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ exe = EXE(pyz,
40
40
console = False ,
41
41
disable_windowed_traceback = False ,
42
42
target_arch = None ,
43
- codesign_identity = None ,
43
+ codesign_identity = MacDeveloperID ,
44
44
entitlements_file = None )
45
45
coll = COLLECT (exe ,
46
46
a .binaries ,
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ appName=" PyThub PyInstaller Desktop"
4
+ # MacDeveloperID="3rd Party Mac Developer Installer: Developer Name (XXXX)"
5
+ MacDeveloperID=" Developer ID Installer: CROGRAM INC. (4LWSS9P873)"
6
+
7
+ # rm -rf ./build/pkg
8
+ mkdir ./build/pkg
9
+
10
+ appPath=./dist/" $appName " .app
11
+ pkgPath=./dist/" $appName " .pkg
12
+
13
+
14
+ # 生成中间 PKG 文件
15
+ pkgbuild --install-location /Applications --component " $appPath " ./build/pkg/intermediate.pkg
16
+
17
+ cd ./build/pkg
18
+
19
+ # 创建分发 XML 文件
20
+ productbuild --synthesize --package ./intermediate.pkg ./distribution.xml
21
+
22
+ # 生成最终的 PKG 文件。此 PKG 文件未签名
23
+ productbuild --distribution ./distribution.xml --package-path ./intermediate.pkg ./unsigned_final.pkg
24
+
25
+
26
+ if [" $MacDeveloperID " = " " ]; then
27
+ # 未签名
28
+ mv ./unsigned_final.pkg ./final.pkg
29
+ else
30
+ # 使用 Mac 开发人员 ID 证书对 PKG 文件进行签名
31
+ productsign --sign " $MacDeveloperID " ./unsigned_final.pkg ./signed_final.pkg
32
+ mv ./signed_final.pkg ./final.pkg
33
+ fi
34
+
35
+ cd -
36
+
37
+ # rm "$pkgPath"
38
+ mv ./build/pkg/final.pkg " $pkgPath "
You can’t perform that action at this time.
0 commit comments