Skip to content

Commit 77a6a2b

Browse files
committed
添加favicon.ico图标文件,并在配置中启用UPX压缩
1 parent cbc2deb commit 77a6a2b

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

package/assets/favicon.ico

18.3 KB
Binary file not shown.

package/nuitka_build.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,22 @@ def main():
106106
if icon:
107107
icon_path = base_dir / icon
108108
if icon_path.exists():
109-
cmd.extend(['--windows-icon-from-ico=icon.ico', str(icon_path)])
109+
cmd.append(f'--windows-icon-from-ico={str(icon_path)}')
110110
else:
111111
print(f"警告: 图标文件不存在 {icon_path}")
112112

113-
# if arrch == "ARM64":
114-
# print("UPX不支持当前架构")
115-
# else:
116-
# if use_upx:
117-
# if upx_dir.exists():
118-
# cmd.append('--plugin-enable=upx')
119-
# cmd.extend(['--upx-binary', str(upx_dir)])
120-
# print(f"使用UPX压缩: {upx_dir}")
121-
# else:
122-
# print(f"警告: UPX目录不存在 {upx_dir}")
123-
# else:
124-
# print("不使用UPX压缩")
113+
if arrch == "ARM64":
114+
print("UPX不支持当前架构")
115+
else:
116+
if use_upx:
117+
if upx_dir.exists():
118+
cmd.append('--plugin-enable=upx')
119+
cmd.append(f'--upx-binary={str(upx_dir)}')
120+
print(f"使用UPX压缩: {upx_dir}")
121+
else:
122+
print(f"警告: UPX目录不存在 {upx_dir}")
123+
else:
124+
print("不使用UPX压缩")
125125

126126
# 添加主Python文件
127127
t_file = str(uuid.uuid4()) + ".py"

package/nuitka_config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
'rich',
99
'Pillow'
1010
]
11-
# upx: true
11+
upx: true
1212
# onefile: 2 # 0:文件夹 1:单文件 2:两者
13-
icon:
13+
icon: package\assets\favicon.ico
1414
windows-disable-console: False
1515
distpath: 'dist'
1616
timeout: 2700
@@ -25,9 +25,9 @@
2525
'pywin32',
2626
'psutil'
2727
]
28-
# upx: true
28+
upx: true
2929
# onefile: 1
30-
icon:
30+
icon: package\assets\favicon.ico
3131
windows-disable-console: False
3232
distpath: 'dist'
3333
timeout: 2700
@@ -42,9 +42,9 @@
4242
'tabulate',
4343
'mutagen'
4444
]
45-
# upx: true
45+
upx: true
4646
# onefile: 1
47-
icon:
47+
icon: package\assets\favicon.ico
4848
windows-disable-console: False
4949
distpath: 'dist'
5050
timeout: 2700
@@ -56,9 +56,9 @@
5656
install-requirements: [
5757
'pyftpdlib'
5858
]
59-
# upx: true
59+
upx: true
6060
# onefile: 1
61-
icon:
61+
icon: package\assets\favicon.ico
6262
windows-disable-console: False
6363
distpath: 'dist'
6464
timeout: 2700
@@ -71,9 +71,9 @@
7171
'pyftpdlib',
7272
'astropy'
7373
]
74-
# upx: true
74+
upx: true
7575
# onefile: 1 # 0:文件夹 1:单文件 2:两者
76-
icon:
76+
icon: package\assets\favicon.ico
7777
windows-disable-console: False
7878
distpath: 'dist'
7979
timeout: 2700

0 commit comments

Comments
 (0)