mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-05-19 20:27:28 +08:00
在代码中添加管理员权限请求功能
- 在gui.py中添加Windows管理员权限检测和请求代码 - 使用ctypes.windll.shell32.ShellExecuteW实现UAC权限提升 - 移除PyInstaller的uac_admin配置避免启动问题 - 优化spec文件确保interface文件正确复制 - 程序现在会在启动时自动请求管理员权限 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,12 @@ datas = [
|
||||
(os.path.join(current_dir, 'ui/icon'), 'ui/icon'),
|
||||
]
|
||||
|
||||
# 手动添加interface文件,确保被包含
|
||||
for filename in os.listdir(os.path.join(current_dir, 'backend/interface')):
|
||||
if filename.endswith('.ini'):
|
||||
src = os.path.join(current_dir, 'backend/interface', filename)
|
||||
datas.append((src, 'backend/interface'))
|
||||
|
||||
binaries = []
|
||||
|
||||
# 收集重要包的数据文件
|
||||
@@ -297,8 +303,6 @@ exe = EXE(
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
icon=['design\\vsr.ico'],
|
||||
# 请求管理员权限
|
||||
uac_admin=True, # 以管理员身份运行
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
|
||||
Reference in New Issue
Block a user