-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathbuild.spec
73 lines (66 loc) · 1.59 KB
/
build.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*- mode: python ; coding: utf-8 -*-
import os
import platform
from dotenv import load_dotenv
# 加載環境變量獲取版本號
load_dotenv()
version = os.getenv('VERSION', '1.0.0')
# 根据系统类型设置输出名称
system = platform.system().lower()
if system == "windows":
os_type = "windows"
elif system == "linux":
os_type = "linux"
else: # Darwin
os_type = "mac"
output_name = f"CursorFreeVIP_{version}_{os_type}"
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[
('turnstilePatch', 'turnstilePatch'),
('PBlock', 'PBlock'),
('locales', 'locales'),
('cursor_auth.py', '.'),
('reset_machine_manual.py', '.'),
('cursor_register.py', '.'),
('browser.py', '.'),
('control.py', '.'),
('.env', '.')
],
hiddenimports=[
'cursor_auth',
'reset_machine_manual',
'browser',
'control'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
target_arch = os.environ.get('TARGET_ARCH', None)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name=output_name, # 使用动态生成的名称
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=True, # 对非Mac平台无影响
target_arch=target_arch, # 仅在需要时通过环境变量指定
codesign_identity=None,
entitlements_file=None,
icon=None
)