File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed
Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -74,17 +74,13 @@ if sys.platform == "linux":
7474exe = EXE (
7575 pyz ,
7676 a .scripts ,
77- a .binaries ,
78- a .zipfiles ,
79- a .datas ,
8077 [],
78+ exclude_binaries = True ,
8179 name = exename ,
8280 debug = False ,
8381 bootloader_ignore_signals = False ,
8482 strip = False ,
8583 upx = True ,
86- upx_exclude = [],
87- runtime_tmpdir = None ,
8884 console = False ,
8985 disable_windowed_traceback = False ,
9086 argv_emulation = False ,
@@ -94,7 +90,7 @@ exe = EXE(
9490 icon = "resources/secrandom-icon-paper.ico" ,
9591)
9692
97- # 创建目录模式输出
93+ # 创建目录模式输出(onedir模式)
9894coll = COLLECT (
9995 exe ,
10096 a .binaries ,
@@ -105,4 +101,3 @@ coll = COLLECT(
105101 upx_exclude = [],
106102 name = "SecRandom" ,
107103)
108- #nothing
Original file line number Diff line number Diff line change 11import os
22import sys
33import ctypes
4- from ctypes import wintypes
54from subprocess import list2cmdline
6- from app .tools .path_utils import get_data_path
75
86from loguru import logger
97
8+ # Only import wintypes on Windows to avoid import errors on other platforms
9+ if os .name == "nt" :
10+ from ctypes import wintypes
11+ else :
12+ # Create a dummy wintypes module for non-Windows platforms
13+ # NOTE: These dummy types are ONLY for import compatibility and type hints.
14+ # They should NEVER be instantiated at runtime because:
15+ # 1. All functions using wintypes check _is_windows() first and return early
16+ # 2. The dummy types lack ctypes-specific attributes like .value
17+ # This design is safe because non-Windows code paths never reach wintypes usage
18+ class _DummyWinTypes :
19+ DWORD = int
20+ BOOL = bool
21+ HWND = int
22+ LPCWSTR = str
23+ UINT = int
24+
25+ wintypes = _DummyWinTypes ()
26+
27+ from app .tools .path_utils import get_data_path
28+
1029_uiaccess_dll = None
1130_user32 = None
1231_kernel32 = None
You can’t perform that action at this time.
0 commit comments