CursorTokenLogin/main.spec
2026-04-07 21:22:37 +08:00

58 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- mode: python ; coding: utf-8 -*-
import os
try:
_SPEC_ROOT = os.path.dirname(os.path.abspath(SPEC))
except NameError:
_SPEC_ROOT = os.getcwd()
_LOGO_ICO = os.path.normpath(os.path.join(_SPEC_ROOT, "logo.ico"))
if not os.path.isfile(_LOGO_ICO):
raise FileNotFoundError(
"找不到图标文件: %s\n请将 logo.ico 放在与 main.spec 同一目录后重新打包。" % _LOGO_ICO
)
_LOGO_ICO_ABS = os.path.abspath(_LOGO_ICO)
# 须与 build.spec 一致,否则 onefile 内无 layout/main.ui会出现「找不到 UI 文件」
_datas = [
(os.path.join(os.getcwd(), 'layout'), 'layout'),
(os.path.join(os.getcwd(), 'assets'), 'assets'),
(_LOGO_ICO_ABS, "."),
]
a = Analysis(
['main.py'],
pathex=[os.getcwd()],
binaries=[],
datas=_datas,
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
upx_exclude=[],
runtime_tmpdir=r'%LOCALAPPDATA%\CursorTokenLogin\runtime',
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=_LOGO_ICO_ABS,
)